Making Barcode in Microsoft Excel

Making Barcode in Microsoft Excel

Some examples how to create barcodes in Microsoft Excel without programming with ActiveX-based version of StrokeScribe barcode generator.

For automatic/bulk barcode placement and VBA-based examples, see the related tutorials.

Requirements

These examples are compatible with all Microsoft Excel versions, starting from Excel 2007.

The barcode generator is not compatible with the online version of Office.

Barcode Ribbon Add-in for Microsoft Excel

You can use our Ribbon Add-in to automate barcode placement in Excel. The add-in is a helper to simplify the ActiveX placement on a worksheet.

Inserting barcode in Excel with Ribbon add-in

Inserting Barcode in Excel as an Active Document

The easiest method but provides less customization. It allows to choose a barcode type and enter the data to encode in the barcode. If you need more customization, see the ActiveX-based example below.

Barcodes inserted as Active Documents are not designed for VBA automation.

1. Switch to the Insert tab on the Excel Ribbon and click Object:

Inserting a barcode object from Ribbon

2. Look for and select the StrokeScribe Document, then press the OK button. The barcode will appear on the worksheet.

A list of available OLE objects in Excel

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

Barcode object context menu in Microsoft Excel

4. Select the desired barcode type and enter some text to encode in the barcode as shown on the picture:

Barcode properties dialog in Microsoft Excel

How to Remove a Border Around the Barcode

To remove the border around the barcode, right-click the barcode object and select Format Control from the context menu. Switch to the Colors and Lines and set the line color to No Line as shown on the picture:

How to remove a border around the barcode in Microsoft Excel

Placing a Barcode in Excel as an ActiveX

1. Switch to the Developer tab, click the Insert->More Controls as shown on the picture:

Inserting an ActiveX control in Microsoft Excel

2. Select the StrokeScribe Control as shown below and then press OK.

A list of available ActiveX controls in Excel

3. Left-click anywhere on the worksheet to paste the ActiveX.

The inserted barcode looks like this:

A barcode Activex object in Microsoft Excel

Adjusting the Barcode Properties

1. Make sure the Design Mode button on the Developer tab is switched on.

2. Right-click the barcode and then select Properties:

A context menu of the barcode generator

To change the barcode type, look for the Alphabet property. To encode your own text string in the barcode, edit the Text property.

The barcode property list

If you see that something goes wrong, check the value of the Error property.

Linking the Barcode Object to a Cell

To link the barcode with a cell, type the cell's name in the LinkedCell property. The picture below shows how to encode data from the cell A1 in QR Code.

Linking a barcode with a cell in MS Excel

If the linked cell contains an all-numeric value, Excel converts it to a floating-point number when passing it to the ActiveX. This may lead to unpredictable results. You should first convert the value to a text string using formula:

=TEXT(A1; "0000000000000") Converting a numeric value to text in Excel

And then link the barcode with the formula cell:

Linking a barcode with a formula