|
EAN 128 / GS1-128 Barcode Add-In for Excel
How to Link Cells with EAN 128 / GS1-128 Barcode in Excel
- Mature EAN 128 / GS1-128 barcode generator with full support for Excel 2007 and 2010
- Fully compatible with GS1 specification. Add-in based on high quality
C# GS1-128 Generator library.
- Easy to generate & create EAN 128 barcode in selected cells, rows and columns of Excel
- Able to convert entire rows or columns of data into EAN 128 barcode in Excel quickly
- Compatible with other linear barcode generation in Excel, such as Code 128 and Code 39
- Available for major 2D barcode generation in Excel, like QR Code, Data Matrix & PDF 417
- Provide flexible perpetual license, including single-user & multi-user licenses
This guide will walk you through the process of generating GS1-128 barcodes directly inside your Excel spreadsheets. Whether you need one barcode for a shipping label or dozens for a product catalog, the BarcodeLib Barcode Generator Add-in makes the task straightforward.
Think of this add-in as a specialized "barcode printer" that lives inside Excel. Instead of printing on paper, it prints accurate, standards-compliant barcode images directly into your worksheet cells. You provide the data, and the add-in handles the technical details.
Quick Start: Creating Your First GS1-128 Barcode

Let's begin with the basics. Once you have installed the BarcodeLib add-in, you can create your first GS1-128 barcode in just a few minutes.
Understanding Your Data Layout
Before we start, let's look at the sample worksheet we will use. It contains GS1 business data organized in columns:
- Column B contains GS1 SSCC data messages. SSCC stands for Serial Shipping Container Code (SSCC) . Think of this as a unique ID for a logistic unit, like a pallet or a large box. In the GS1 system, the Application Identifier (AI) for SSCC is (00) . An AI is like a label that tells the scanner what kind of data follows.
- Column C contains GS1 GTIN data messages. GTIN stands for Global Trade Item Number (GTIN) . This is used to identify products—anything you might buy in a store. Its GS1 Application Identifier is (01) .
- Column D contains complete GS1 business data messages. Some cells combine both SSCC and GTIN data into one string.
- Our goal is to create GS1-128 barcodes in column E that encode the values from column D.
1: Preparation (Set Up Your Excel Environment)
- Open Your Excel File: Launch Microsoft Excel and open the document that contains your GS1 data. If you are following along with the sample, you will see the columns described above.
- Locate the Add-ins Tab: Look at the ribbon menu at the top of your Excel window. Click on the tab labeled "Add-ins" . (This is where Excel places all third-party tools.)
- Open the Barcode Pane: In the "Add-ins" tab, find the group named "BarcodeLib" . Inside this group, click the button that says "Create Barcode" .
- A new panel should appear on the right side of your Excel window. It will be titled "Barcode Settings." This is your control center for all barcode operations.
Generate Your First Barcode
- Select the Target Cell: Click on cell E4 to select it. This is where your first GS1-128 barcode will appear.
- Choose the Correct Barcode Type: In the "Barcode Settings" pane, find the dropdown menu labeled "Barcode Type" . Click it and scroll down to select "GS1 128 (UCC/EAN 128)" from the list. (This is the specific "dialect" of Code 128 used for GS1 data.)
- Link to Your Data: In the "Data" text box, type the following formula exactly: =LINK(D4)
This formula creates a connection. It tells the barcode in E4: "Go look at cell D4. Take whatever GS1 data message is there and encode that." Cell D4 contains a complete GS1 business data message.
- Generate the Barcode: At the bottom of the "Barcode Settings" pane, click the Generate button.
Check Your Result
- Look at cell E4. You should now see a GS1-128 barcode image appear directly in that cell.
- It encodes the GS1 data message from cell D4. You can verify this by looking at the human-readable text printed below the barcode. It should match the content of cell D4.
Note: If you do not see a barcode, double-check that you selected cell E4 before clicking "Generate." Also, ensure that cell D4 contains a properly formatted GS1 data message, such as (01)99012345678909.
Keeping Your Barcodes Updated

Once your barcode is created, you need to ensure it stays accurate when your source data changes. There are two ways this can happen.
Automatic Updates (When the Add-in Is Open)
- If the "Barcode Settings" pane is still open, go to cell D4 and modify its value. For example, change one of the numbers in the GS1 message.
- Watch cell E4. The barcode image will refresh itself automatically to encode the new data. No extra steps are needed! This is the add-in's "live connection" feature at work.
Manual Updates (When the Add-in Was Closed)
However, there is a scenario to watch out for. If you close the "Barcode Settings" pane, save your file, and then later change the data in column D, the barcode images will look old and incorrect. They will not update because the add-in was not active.
To manually update a barcode:
- Select the Barcode: Click on the GS1-128 barcode image you want to update (for example, the one in cell E4).
- Open the Add-in (if closed): If the "Barcode Settings" pane is not visible, go back to the "Add-ins" tab and click "Create Barcode" to reopen it.
- In the "Barcode Settings" pane, locate and click the Update button. (It is usually found near the bottom, next to the Generate button.)
- The selected barcode will regenerate and now reflect the latest data from its linked cell.
Creating Multiple GS1-128 Barcodes from a List

Now let's explore a more powerful feature: generating a whole list of barcodes from a column of data. This is perfect for when you have many GS1 data messages to encode.
We will use the same sample Excel document. It has GS1 business data messages in column D (rows 4 through 8). We already created a barcode in cell E4. Now we want to fill cells E5 through E8 with barcodes for the remaining data.
Identify Your Template
- Select the Template Barcode: Click once on the GS1-128 barcode image in cell E4 to select it.
- Check the Confirmation Message: Look at the top of the "Barcode Settings" pane. You should see a message that says: "Copy from: Cell [E4] GS1-128" . This confirms the add-in recognizes this barcode as a source for duplication. It means any new barcodes we create will have the same settings (barcode type, size, font, etc.) as this one.
Duplicate to Fill the Column
- Select the Target Range: Click and hold your mouse, then drag downwards to select the cells where you want new barcodes to appear. For this example, select the range E5 through E8 . (Make sure you select the cells themselves, not the barcode image.)
- Duplicate the Settings: In the "Barcode Settings" pane, find and click the button labeled "Duplicate All" . (This button tells the add-in to create new barcodes in all the selected cells, using the first one as a template.)
- Look at cells E5, E6, E7, and E8. New GS1-128 barcodes have been inserted into each cell. Each one automatically encodes the GS1 data message from its corresponding cell in column D (E5 encodes D5, E6 encodes D6, and so on).
Note: If you get an error during duplication, it is often because the destination cells (E5, E6, etc.) are not wide enough. Try widening column E a bit before using the "Duplicate All" function.
Bulk Updates
Now that you have multiple barcodes, keeping them all updated is also simple.
- Automatic Bulk Update: If the "Barcode Settings" pane is open and you change any value in cells D4 through D8, watch what happens. All linked barcode images in column E will update themselves automatically.
- Manual Bulk Update: If you need to update all barcodes at once (for example, after making changes with the add-in closed):
- Open the "Barcode Settings" pane if it is not already open.
- Look at the bottom of the pane and click the "Update All" button.
- All GS1-128 barcode images in your active worksheet will regenerate to reflect the latest data.
Understanding GS1-128 Barcode Technology

To use GS1-128 effectively, it helps to understand what makes it special. Let's break down the technology in simple terms.
What Is GS1-128?
The GS1-128 barcode is a special subset of the more general Code 128 barcode symbology.
- Think of Code 128 as a versatile "alphabet" that can write many different kinds of messages. GS1-128 is a specific "dialect" of that alphabet, used exclusively for GS1 standards in supply chains.
Here is the technical background, explained simply:
- By agreement between AIM (the association for automatic identification and mobility) and GS1 (the global standards organization), a special character called the Function 1 Symbol Character (FNC1) is used in a specific position within the barcode.
- The use of FNC1 in the first character position after the start character is reserved exclusively for the GS1 system.
- This makes GS1-128 a flexible symbology that can encode "element strings" using GS1 Application Identifiers (AIs). An element string is simply a piece of data, like a product number or an expiration date, preceded by its AI code.
Why Use the BarcodeLib Excel Add-in?
As an efficient and convenient tool, the GS1-128 Barcode Excel Add-In is commonly used to insert GS1-128 barcode images into Excel workbooks. It is designed to be simple and easy, even for users who have no special programming skills.
For more detailed guidance, you can explore these related topics:
- How to generate 1D and 2D barcodes in Microsoft Excel without any fonts, VBA, formulas, or macro programming.
- How to create multiple (bulk) barcodes in a Microsoft Excel sheet.
- How to encode and print GS1 barcodes in Office Excel 365.
- How to create barcodes in Word mail merge using data from Excel cells.
- How to create and draw barcodes with a specified width and height in Excel.
BarcodeLib.com provides a full range of barcode generators (not fonts) for Excel and Word. This includes add-ins for Code 39, Code 128, UPC-A, QR Code, Data Matrix, and many others.
GS1-128 Barcode Data Encoding in Excel

Now let's dive deeper into how data is structured for GS1-128 barcodes.
What Does GS1-128 Data Encoding Look Like?
A GS1-128 barcode data message is composed of a list of groups. Each group consists of a GS1 Application Identifier (AI) code and its associated data field.
• All GS1 Application Identifier codes and their data contain text characters from The GS1 subset of International Standard ISO/IEC 646 . Think of this as a specific, agreed-upon character set that all GS1 systems understand. It ensures that a barcode created in one country can be read correctly in another.
A Practical Example
Look at this sample barcode message: (00)395123451234567895
- It includes one group: GS1 AI Code (00) and AI data 395123451234567895.
- The AI (00) indicates that the following data field contains an SSCC (Serial Shipping Container Code) . So a scanner reading this barcode knows immediately: "This is a logistic unit identifier."
What Are the Data Length Limits?
- A GS1-128 barcode must contain at least one group of an Application Identifier (AI) and its data.
- In a single GS1-128 barcode, the maximum number of data characters you can encode is 48 . This includes all AI codes and their data. If your message is longer than 48 characters, you may need to split it into multiple barcodes.
What Character Set Does GS1-128 Support?
GS1-128 supports several types of characters:
- Data Characters: The actual GS1 data message text comes from the GS1 subset of ISO/IEC 646 (essentially numbers, uppercase letters, and a few special symbols).
- Function Characters: There are four non-data function characters: FNC1, FNC2, FNC3, FNC4 . (Note: FNC2 and FNC4 are not used in GS1-128 barcodes.) The FNC1 character is the most important—it acts as a "flag" that tells the scanner this is a GS1-128 barcode.
- Control Characters: Four code set selection characters help the barcode switch between different "modes" of encoding.
- Start/Stop Characters: Three start characters and one stop character tell the scanner where the barcode begins and ends.
How the Excel Add-in Simplifies This
Using the BarcodeLib Excel barcode generator, you do not need to worry about encoding function characters or start/stop characters manually.
- You only need to provide the GS1 data message itself (for example, (01)99012345678909(15)241015(21)abc).
- The barcode generator software will automatically insert the required function characters (like FNC1) and control characters into the GS1-128 barcode symbology for you. You can focus on your data, and the software handles the technical encoding.
What About Check Digits?
- GS1-128 barcodes have one mandatory symbol check character . This is a built-in error-checking feature.
- The check digit is calculated from all the other characters in the barcode. It helps the scanner confirm that it read the data correctly.
- The check digit character is for the scanner's use only. It will not be displayed in the HRI, or Human Readable Interpretation (HRI). The text printed below the barcode.
- In the Excel barcode generator, the property "Add checksum char" is not applicable for GS1-128. The encoder software automatically adds one check character before the stop character in every GS1-128 barcode symbol. You do not need to do anything.
Encoding Complex GS1 Data Messages in Excel

A GS1 data message can include multiple "element strings" in one barcode. This is what makes GS1-128 so powerful—you can encode several pieces of related information in a single, scannable image.
A Practical Example with Multiple Elements
Here is a sample GS1 data message: (01)99012345678909(15)241015(21)abc
This message contains three element strings, each with its own AI:
- (01)99012345678909 : The AI 01 stands for GTIN (identification of a trade item). This AI code is followed by a fixed length of 14 digits.
Think of this as the product's "fingerprint." It uniquely identifies what the item is.
- (15)241015 : The AI 15 stands for Best Before Date . This AI code is followed by a fixed length of 6 digits in the format YYMMDD. The example date here is October 15, 2024.
This tells you and the scanner how long the product is good for.
- (21)abc : The AI 21 stands for Serial Number . A serial number is assigned to an individual item for its lifetime. When combined with a GTIN, it uniquely identifies a single, specific item (like "this particular bottle" versus "this type of product"). A serial number has a variable length, from 1 to 20 alphanumeric characters.
While the GTIN says "this is a 500ml bottle of Brand X water," the serial number says "this is bottle number 12345 out of the million produced."
How to Enter This in Excel
When you encode a GS1 data message in Excel, you type it exactly as shown, with the AI codes surrounded by parentheses and followed immediately by their data fields.
- In the "Barcode Settings" pane, simply type the complete message into the "Data" text box, like this:
(01)99012345678909(15)241015(21)abc
- Alternatively, you can type this message into a cell (say, D4) and use the =LINK(D4) formula in the "Data" text box. This is often easier for longer or more complex messages.
Note: Make sure you include the parentheses around each AI code. The parentheses are not encoded in the barcode itself, but they tell the add-in where each AI begins and ends. The software then uses this information to insert the correct FNC1 separators automatically.
Advanced Batch Generation: Using the Batch Barcode Tool

We have already seen how to duplicate barcodes using the "Duplicate All" feature. There is another method using the "Batch Barcode" tool, which gives you additional control, especially when working with large datasets.
The Sample Document
We will use the same sample Excel document:
- Column B: Contains SSCC numbers (AI code 00).
- Column C: Contains GTIN numbers (AI code 01).
- Column D: Contains complete GS1-128 numbers, which are combinations of columns B and C.
- Column E: Will hold our barcodes. A sample GS1-128 barcode has already been created in cell E4.
Now, let's create multiple GS1-128 barcodes in Excel for the remaining GS1-128 numbers in cells D5 through D8.
1: Open the Batch Barcode Tool
- In the Excel ribbon, go to the "Add-ins" tab.
- Look for and click the command "Batch Barcode" . (It is usually located near the "Create Barcode" button.)
- This will open a new panel named "Batch Barcodes" on the right side of your document. This panel is specifically designed for creating many barcodes at once.
2: Select Your Data Source
- In the "Batch Barcodes" pane, you will see an option to select your data range. Look for a field labeled "Data range" or similar.
- Click and drag to select the cells that contain your GS1 data messages. For this example, select the range D5 through D8 . (These are the source cells whose values we want to encode.)
- Click the button "Generate Batch Barcodes" in the pane.
3: Choose Your Template and Destination
- The add-in will now ask you to choose a barcode image to use as a template. Click on the barcode image in cell E4 . This ensures all new barcodes will have the same settings (barcode type, size, font, etc.) as this one.
- Next, the batch generation guide will prompt you to choose a starting cell for the new barcodes. Look for a prompt like "Choose a cell to hold the first batch barcode" .
- Click on cell E5 to select it as the location for the first new barcode.
- Click the button "Generate Batch Barcodes" again (or a similar "Finish" or "Generate" button).
4: Verify the Result
Look at your worksheet from cell E5 down to E8. New GS1-128 barcodes have been created and inserted into each cell. Each barcode encodes the GS1 data message from its corresponding cell in column D.
You have now successfully generated multiple GS1-128 barcodes in just a few clicks within your Excel document.
GS1-128/UCC/EAN-128 Barcode Property Settings
- Set the Barcode Type property to GS1 128.
- Set the Data property with the value to encode.
Type is string.
- Valid Data Scope:
- all 128 characters of ASCII
- Sample: "(21)2345777(21)12345678"
- About AI (Application Identifiers)
In Barcode Library, you can use (dddd) format to encode AI code. For example, to encode AI code 21 with value d12345777,and AI code 21 with value 12345678, you should set Data = "(21)d12345777(21)12345678".
- Check the Apply Tilde (~) property,, if you want use the tilde character "~" to specify special characters in the input data.
- ~1: is used to represent the FNC1 code.
- ~2: is used to represent the Structured Append and must be followed by a 3-digit number between 1 and 255.
- ~3: is used only at the very beginning of the symbol for the reader programming purpose.
- ~5: is used only at the very beginning of the symbol, the header [)> + ASCII 30 + ASCII 05 + ASCII 29 will be transmitted by the barcode reader before the data in the message and the trailer ASCII 30 + ASCII 4 will be transmitted afterwards.
- ~6: is used only at the very beginning of the symbol, the header [)> + ASCII 30 + ASCII 06 + ASCII 29 will be transmitted by the barcode reader before the data in the message and the trailer ASCII 30 + ASCII 4 will be transmitted afterwards.
- ~7NNNNNN: is used to specify the Extended Channel and NNNNNN is a value between 000000 and 999999.
- ~dNNN: is used to represent the ASCII character with the value of NNN.
- Add checksum char property is not applied.
- Barcode Size Settings.
- Set property Unit of Measure (Unit of Measure) for properties Bar Width, Bar Height, Margins.
Valid values are Pixel, CM, Inch.
- Set the Image Width and Image Height properties.
Both types are float.
- Set the Bar width (X) (for bar cell width) and Bar height (Y) (for bar cell height) properties.
Both types are float.
- Set the Left Margin, Right Margin, Top Margin and Bottom Margin properties.
Types are all float.
- If the Auto Resize property is chacked, the generated barcode image width and height will be the same as property "Image width", and "Image hight", and it will generate the maximum Bar Width and Bar Hight.
- Set the DPI property (Value is expressed in DPI - Dots per inch).
Type is int.
- Setting up Barcode data text style in barcode image (Tab: 1D Barcode).
- Set the Display barcode data properties. If Display barcode data is checked, barcode data will be displayed with the barcode.
- Set the Font property. The font used to display text in barcode image.
- Set Rotate property.
If you want to rotate barcode image, valid values are : 0, 90, 180, 270
| |