Use Vb Script To Identify Number Of Records In Excel File S’abonner

0
Avatar
Legacy Poster

Hi there, i was wondering if could it possible to use vb script (or any alternative ways)for my case?

I'm using Bartender 10.0 trial and i wish to connect my label template to the excel file. The quantity of the label will print out according to the number of the records in the excel files. Let say that if the excel file has 10 records store in it, it will print out 10 labels with each refers to each record in excel.

If it can be done,can someone guides me on it?

By the way, if i use Bartender Professional edition,would it support this features? or i have to go for Enterprise Automation?

Any helps would be much appreciated. Thanks.

1 commentaires

0
Avatar
Shotaro Ito
Actions pour les commentaires Permalien

Hi Tbzserge,
I would recommend to create an extra column in excel sheet - with formula, such as
[sql]=COUNTA($A$2:$A$9999)[/sql]
[attachment=267:addRowsColumn.png]

Another way, VB Script is a bit tricky.
From BarTender 9.4 or later, you can have Live database value in design view and record navigator at the bottom.
when you click connect / disconnect button, you can switch live database view and sample data view.
Only when record navigator is enabled, you can get number of records by VBscript, from Format.ViewRecordNavigator.LastRecord property.
[code]
'Format.ViewRecordNavigator.LastRecord can be only used when Design view record navigator is enabled.'
If Format.ViewRecordNavigator.IsConnected = True Then
Value = Format.ViewRecordNavigator.LastRecord
Else
Value = "<Error> Enable record navigator."
End If
[/code]
[attachment=268:recordnavigator.png]

Both method can be used by Professional edition or above.
Hope that helps.

Vous devez vous connecter pour laisser un commentaire.