PDF417 barcode in Excel

PDF417 in Microsoft Excel

Table of Contents

Examples how to make PDF417 barcodes in Excel without or with minimal programming effort.

Setup

Placing PDF417 in Excel Using Active Document

An example how to use the Active Document version of StrokeScribe barcode generator to create and customize PDF417 in Excel.

The Active Document is easy to insert but provides less customizations. If you need to create a dynamic barcode by linking the object to a cell, use the ActiveX-based method.

1. On the Insert tab on the Ribbon, click Object.

2. Look for the StrokeScribe Document in the dialog:

Inserting a barcode in Excel as an Active Document

3. Right-click the barcode object, select StrokeScribe Control->Properties from the context menu.

Setting up PDF417 in Excel

PDF417 Customization

Switch to the Code-specific 2 tab in the barcode properties dialog.

Here, you can set the error protection level and fix the number of rows/columns. More properties are available in the ActiveX/Class/DLL versions of the barcode generator.

The number of rows must be in the range of [1..90]. The number of data columns must be in the range of [1..30]. There is no need to specify them both at the same time.

Customizing the PDF417 barcode

If the error protection level is set to -1, the barcode genertor will automatically choose optimal error correction level. The value of 0 forces to use the weakest error correction and produces a small barcode. The value of 8 gives the best data protection but increases the barcode size.

Here is how compare barcodes with the same data, but with different error protection levels:

How compare different error correction levels in PDF417

Compact/truncated PDF417

To create a truncated version of a PDF417 barcode, set the CompactPDF417 property as shown below. This option is available only when creating barcodes programmatically or through the ActiveX properties sheet:

StrokeScribe1.CompactPDF417 = True

A Compact PDF417 symbol doesn't have a sync pattern on the right side as shown below. Use this barcode type only on clean surfaces.

A compact/truncated PDF417 barcode example

Placing PDF417 Barcode in Excel Using ActiveX

The ActiveX-based barcode generation may require some programming but allows to produce PDF417 in bulk quantities.

1. Switch to the Developer tab on the Excel Ribbon and click Insert->More Controls as shown below.

2. Select StrokeScribe Control from the list of available objects and press OK:

Inserting a barcode in Excel as an ActiveX

3. Click anywhere on the sheet to insert the barcode object.

4. Activate the Design Mode button on the Developer tab.

4.1. Right-click the barcode object, select Properties or activate the Properties button on the Ribbon:

The Properties button in Excel

5. Use the property list to customize your barcode. To create a PDF417, modify the following properties:

The PDF417 property list

Customizing the ActiveX-based PDF417

The PDF417ModuleAspectRatio property allows to set the height:width ratio of PDF417 modules. The default vaue is 3 (i.e. 3:1); The higher values (4:1 or 5:1) are recommended for barcodes with weak error correction levels and for for use on dirty surfaces.

This is how a PDF417 barcode with 5:1 module aspect ratio looks like:

An example of PDF417 with 5:1 module aspect ratio

Linking PDF417 to a Cell

To automatically update the barcode when a cell content changes, use the linked cell technique.

PDF417 Customization with VBA

1. Press Alt+F11 to open VBA window. Double-click the current sheet name in the VBA project tree:

PDF417 barcode customization - opening VBA editor

2. Paste the following code into the VBA editor:

Sub CreateBarcode() StrokeScribe1.Alphabet = PDF417 StrokeScribe1.Text = "123ABCD" ' Any text to encode in the barcode ' Optional PDF417 parameters: StrokeScribe1.Rotation = 90 StrokeScribe1.PDF417ErrLevel = 3 ' Optional error correction level StrokeScribe1.CompactPDF417 = 1 ' Creates a Compact PDF417 barcode StrokeScribe1.PDF417Cols = 3 ' Fixed number of the data columns End Sub

3. Place the caret into the Sub body, press F5 to run the code and switch back to the Excel window to enjoy the barcode.

To encode data from a cell, use the following code:

StrokeScribe1.Text = Range("A1")

FAQ: Creating PDF417 barcodes in Excel

Q: Can I use Excel to create a batch of PDF417?

You can create a batch PDF417 by using our formula-based example and COM-version of our barcode generator. This feature allows to generate barcodes for multiple rows or columns at once. Look for the formula/DLL examples in the Related Tutorials.

Q: Is there a limit to the size or number of barcodes I can create in Excel?

There is no strict limit imposed by Excel. But, if you are trying to ues ActiveX objects to create PDF417 barcodes, we do not recommend to create more than 1000 objects.

For bulk PDF417 generation, use our formula/DLL examples - they output barcodes as vector pictures or use fonts. These barcode rendering methods are memory-efficient.

Q: Can I create dynamic PDF417 barcodes that update automatically when data in Excel changes?

Use our formula-based example to create PDF417 barcodes, or link an ActiveX instance of the barcode generator to a cell using the LinkedCell property.

Q: Why my PDF417 is not scanning properly?

Check the following:

Facebook X Bluesky Youtube Contacts

© 2026 StrokeScribe. All rights reserved. Use of any portion of this site constitutes acceptance of our Terms of Use and Privacy Policy. The website material may not be reproduced, except with the prior written permission.