Generate EAN-13 Barcodes in Excel with StrokeScribe - a Step-by-Step Guide

Tags: Excel, EAN-13, manually, formula, VBA

An example how to insert EAN-13 barcode in Excel with StrokeScribe barcode generator.

For more examples including bulk barcode generation, look in the related tutorials.

Requirements

Placing EAN-13 as an Active Document

The method is good when you need a single EAN-13 barcode with manual data entry. This method does not require programming, but it is less customizable.

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

Inserting the barcode generator object in Excel as an Active Document

2. Look for the StrokeScribe Document in the list:

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

The barcode generator context menu Changing the EAN-13 barcode properties

The EAN-13 generator does not have any user-adjustable settings. You may only adjust the quiet zone size on the Additional tab.

Placing EAN-13 in Excel with formula

1. Open the VBA window (Alt+F11) and create a standard module (VBAProject->Insert->Module). Do not use a worksheet or a workbook module - the formula will not call a function from there.

2. Paste the following code into the module:

Function CreateBarcodeEAN13(data As String) As String Dim AC As Range Set AC = Excel.Application.Caller Dim wsh As Worksheet Set wsh = AC.Worksheet shname = "barcode_" & AC.Address() On Error Resume Next wsh.Shapes(shname).Delete On Error GoTo 0 bar_w = AC.MergeArea.Width bar_h = AC.MergeArea.Height Dim ean13_generator As StrokeScribeClass Set ean13_generator = CreateObject("STROKESCRIBE.StrokeScribeClass.1") ean13_generator.Alphabet = EAN13 ean13_generator.Text = data image_path = Environ("TEMP") & "\EAN13.wmf" rc = ean13_generator.SavePicture(image_path, WMF, 1440, 1440 / (bar_w / bar_h)) If rc > 0 Then CreateBarcodeEAN13 = ean13_generator.ErrorDescription Exit Function End If Dim shp As Shape Set shp = wsh.Shapes.AddPicture(image_path, msoFalse, msoTrue, AC.Left, AC.Top, bar_w, bar_h) shp.Name = shname Kill image_path CreateBarcodeEAN13 = "" End Function

3. Add a reference to the StrokeScribe Class into your VBA project.

4. Switch back to the Excel window. Choose a cell and type in the formula field:

=CreateBarcodeEAN13("123456789012") or =CreateBarcodeEAN13(A1) Inserting EAN-13 barcode with formula

Conclusion

Creating EAN-13 barcodes in Excel can provide several benefits for businesses and individuals looking to streamline their inventory management, sales processes, and data tracking. Excel is a widely accessible and familiar tool, making it an excellent choice for generating EAN-13 barcodes without the need for specialized software.

By leveraging Excel’s functions and formulas, users can create barcodes efficiently and cost-effectively, maximizing productivity without a steep learning curve. One of the key benefits of generating EAN-13 barcodes in Excel is its simplicity and accessibility. Excel is a common tool used in businesses of all sizes, so there’s no need to invest in dedicated barcode generation software.

With the help of barcode fonts or add-ins, users can convert numerical data into scannable barcodes quickly. This capability allows businesses to maintain accurate and organized records of their products, leading to better inventory management and reducing the risk of human errors during data entry.

Another advantage is the ability to customize and integrate EAN-13 barcodes directly into existing spreadsheets. Businesses often maintain extensive product databases in Excel, and adding barcode generation to the same platform simplifies operations. This integration minimizes the need to transfer data between systems, reducing time-consuming tasks and the likelihood of discrepancies. Additionally, users can adjust the formatting, layout, and size of barcodes according to their specific needs, making it versatile for labeling products, packaging, and documents.

Excel’s capability to handle large datasets efficiently makes it ideal for generating bulk EAN-13 barcodes. Instead of manually creating each barcode, users can use Excel’s drag-and-fill features, along with formulas, to automate the process for thousands of products. This scalability is particularly valuable for retail businesses, wholesalers, and manufacturers dealing with extensive inventories. It also helps in maintaining a standardized approach to labeling, making it easier to track and manage products across various departments or locations.

Finally, the ability to create EAN-13 barcodes in Excel offers a cost-effective solution. Businesses can avoid the expenses associated with purchasing dedicated barcode software or outsourcing barcode generation. With readily available barcode fonts and add-ins, Excel becomes a powerful yet affordable tool for managing product identification. This cost savings can be particularly beneficial for small businesses and startups looking to optimize their inventory processes without straining their budget.