Save The Field Data Bartender To An Excel 追蹤

Legacy Poster

Hi there, i would like to save the record to an excel after printing from Bartender template. Example there are 2 field in template, one is part number another is running number. I want to save the part number and running number so that i can know the particular part number has reached what running number.


Question that i concern:

1. Is Bartender able to save the record of the field to the excel that i specify using VB script? As i know, Bartender is capable link to the excel and get the field data of it only.


2.Or do i need a Automation or higher version? So that i can develop a simple program that will utilise ActiveX Bartender to print the label as well as save the record to excel from the program


Any help would be appreciated. Thanks.



1 意見

Ian Cummings
評論操作 永久連結

Yes, an event based VB script can be used to read in a value at the start of a print job, and then write an updated value back to the same field/record at the end of the print job.  Like when reading an updated serial number for a product for example.


Another example is to use a VB script to mark a record that is used in a print job as having been printed.  Here is a code example to give you an idea:


OnNewRecord event
'Define the object names.
dim objConn
dim strConn
dim rs
'Define the database connection parameter constants.
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = &H0001
'Connect to the Excel file.
Set objConn = CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='C:\Seagull\Fruits.xls';Extended Properties=""Excel 8.0;HDR=YES;"""
'Create a record set of one record which is the current record being printed.
Set rs = CreateObject("ADODB.Recordset") "SELECT * FROM [Sheet1$]", objConn, adOpenStatic, adLockOptimistic, adCmdText
rs.Find "Product = '" & Field("Sheet1$.Product") & "'"

'Set the "Printed" field of the record to be "YES" thus flagging it as having been printed.
rs.Fields("Printed") = "YES"