Step-by-Step Guide: Integrating UPC-A Barcodes with MS Excel

Learn how to automate barcode generation in Microsoft Excel using Barcodesoft fonts and VBA macros. This tutorial covers security settings, DLL referencing, and formula application.

1

Configure Excel Macro Security

Before generating barcodes, you must enable macros to allow the Barcodesoft logic to run.

Excel 2000 or 2003:

Navigate to Tools > Macro > Security and choose the Low security level.

UPC-A Macro Security Settings

Excel 2007 - 2019+ :

Office 2010 button Office 2016 button Office 2019 button

Go to Excel Options > Trust Center. Under Macro Settings, select "Enable all macros".

UPC-A Macro Trust Center Settings
2

Initialize Visual Basic Editor & References

Press ALT + F11 to open the Microsoft® Visual Basic editor.

Excel VBA Editor Window

Add Barcodesoft DLL

Follow path: Tools > References > Browse

C:\Program Files (x86)\CommonFiles\Barcodesoft\Fontutil\cruflbcs.dll

Select "crUFLBcs 1.0 Type Library" and click OK.

Adding Barcodesoft DLL Reference
3

Import the Barcode Macro Module

Press Ctrl + M to import the module. Select barcodesoft.bas.

Importing VBA Code for Barcode Generation
4

Encoding Data using Formulas

Close the VBA editor. You can now use Excel formulas to encode your data. This is ideal for batch processing entire columns.

Macro

=upca(A1)

=upce(A1)

Pro Tip: Leading Zeros

If your UPC code starts with a 0, type an apostrophe (') before the zero to prevent Excel from omitting it.

Applying UPC-A Barcode Formula in Excel
5

Apply the UPC-A Barcode Font

To visualize the encoded data as a barcode, change the cell's font typeface.

  1. Right-click the target cell (e.g., B1).
  2. Select Format Cells.
  3. Under the Font tab, choose UpcEanM.
Selecting Barcode Font Typeface