Creating an integration that uses an Excel document as a trigger file Follow

Samantha Petro

This articles applies to BarTender 2019 R5 and newer.

With Revision 5, BarTender 2019 can now use an Excel document as a trigger file in an integration, open it, and use the data contained within it.

Note: If you are on R4 or earlier, this process will not work. Please see this article about checking your revision and updating: How to update to the current revision of BarTender

 This tutorial will walk you through the following:

  • Using an excel file as a database
  • Setting up a file integration
  • Testing and deploying your integration

This tutorial walks you through the basic process of setting up this type of integration. Once you've tried it out, feel free to follow the same steps with your own data. 


Creating the label file

  1. Download database.xlsx to use as your database file.
  2. Open BarTender Designer and create a new document.
  3. When you complete the new document wizard, go to File > Database Connection Setup.
  4. Select "Create a new database connection" and click Next
  5. Select "Microsoft Excel" from the list and click Next
  6. Use the Browse button to locate the file, database.xlsx. Select it and click Next
  7. On this screen, leave everything default. You can take a look at the file preview to see how your database looks with these settings.
    1. Our data is all contained on Sheet1, the only sheet in the Excel document
    2. Our first row contains the names of our fields
  8. Click Next then Finish. Click OK to close the database dialog.
  9. Now that the database is connected, click on the Data Sources tab in your toolbox if it is not already selected.
  10. Click and drag both fields onto your label
  11.  Save your label. It is now ready for use!


 Creating the Integration

  1. Open Integration Builder
  2. From the start screen, select "Create New Integration"
  3. Select "File" from the dialog and click OK.
  4. Under File Detection, choose your scan folder location. This is where the Integration will be picking up files.
Note: It is recommended that you choose a folder in a common location such as the C drive. Folders in My Documents or the desktop may require special permissions to access them.
  1.  Change the file pattern to *.xlsx, since we'll be scanning for Excel files.
  2. Click on the Print Document action.
  3. On the Document tab, use the Browse button to navigate to the document you created in the previous section. Like with the scan folder, it's recommended this document be located in a centralized folder and not in My Documents.
  4. On the Print Options tab, check the box next to "Use data source" and select "File" from the dropdown list.
  5. In the File Name box, enter "%FilePath%" without the quotes.
  6. Save your file. 


Testing and deploying the Integration

Before we deploy the integration, we'll want to test it and create some sample trigger files. The trigger files must match the same structure as the database linked to the label file. Here's some sample data for testing. This has different data than was in the label's database but the structure is the same:

Please download trigger.xlsx for testing.

  1. With the integration open, click on the Test tab.
  2. Click the green Start button on the top ribbon.
  3. Drop trigger.xlsx into the scan folder you set in the previous section.
  4. Integration messages will start appearing, confirming that the integration has picked up the file.
  5. Once you have a successful print, it's time to deploy.
  6. Click the Deploy tab then the green Deploy button.
  7. If you have not saved your file, you will be prompted to do so.
  8. Click the dropdown menu and select "This Computer" from the list. Click next.
  9. Select "Deploy now" then click Finish.
  10. Your integration is now deployed.

Tran Son
Comment actions Permalink

I follow exactly all the steps, but it has the error  "A connection to database "database" could not be made"

I've tried all the Troubleshooting Excel and BarTender as mentioned here (file closed, permission ok as I'm the only user, latest Access Database Engine installed, the Office is 64-bit and the same with Bartender).

I've tried everything for two days, with no success. Please kindly help.


Please sign in to leave a comment.