Get Last Record From Column X From Excel File Through Vb Script Follow

0
Avatar
Legacy Poster

Hi folks,

 

in my label i would like to grab the last used record from an excel file using vb script when opening the label.

 

For instance, my excel file has in the first column:

 

products

product1

product2

product3

 

The label should display product3. I need to use vb scripting since i am planning to create another database connection with the same label.

 

I assume product3 in this example should be named as some data source but i got no clue whatsoever how the vbscript should look like. 

 

Any help on this i would greatly appreciate, thanks!

2 comments

0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

I guess the rs.MoveLast method would be your best bet:  See example from MSDN: https://msdn.microsoft.com/en-us/library/ms676810(v=vs.85).aspx

0
Avatar
Legacy Poster
Comment actions Permalink

Thanks Ian for your suggestion 

Please sign in to leave a comment.