PDF417 barcode in Excel

PDF417 in Microsoft Excel

Table of Contents

Here are some examples how to produce PDF417 barcodes in Excel with our barcode generator.

You will learn how to bind the barcode object to a cell, how to set the error correction level in a PDF417 barcode, how to print a barcode with a fixed number of rows or columns, and how to create Compact PDF417 barcodes.

These examples do not require specialized fonts or Internet connection.

Features

The PDF417 generator provides the following features:

Setup

Placing PDF417 in Excel Using Office Ribbon Add-in

If you need to insert a single PDF417 barcode, use our Ribbon Add-in. It is just a helper to insert ActiveDocument or ActiveX instances of the barcode generator in easy way.

The picture below shows how to insert a PDF417 barcode:

Inserting a barcode in Excel using Ribbon Add-in

After inserting, double-click the barcode to edit it's properties. On the General tab, enter a text to encode in the barcode. On the Code specific tab, you can fix the number of rows and columns.

See more information about barcode properties in the PDF417 Customization section.

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.

How to Remove a Border Around the Barcode

Use this example from the Excel barcode generation guide.

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

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 are recommended for barcodes with weak error correction levels.

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 correcion 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.