Answer the question
In order to leave comments, you need to log in
How to get first sheet name in Excel using VBScript OpenSchema?
I have an excel file with several sheets .
I need to open the first sheet through VBS
. My code is:
strConn="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=file.xlsx;Extended Properties=""Excel 12.0; ReadOnly=true; HDR=No;IMEX=1"""
Set conn = CreateObject("ADODB.Connection")
conn.Open strConn
set tables = conn.OpenSchema(20)
do until tables.eof
wscript.echo tables("TABLE_NAME")
tables.movenext
loop
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question