Aller au contenu principal

Recherche

Recherche

Use Vb Script To Identify Number Of Records In Excel File

Commentaires

1 commentaire

  • Avatar
    Shotaro Ito
    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.
    0

Vous devez vous connecter pour laisser un commentaire.