Hi All,
How can I get the list of sheets of a given excel file
Printable View
Hi All,
How can I get the list of sheets of a given excel file
using ADO..
Code:Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=<XLS filename>;" & _
"Extended Properties=""Excel 8.0; HDR=Yes"";"
Set rs = cn.OpenSchema(adSchemaTables, Array(Empty, Empty, Empty, "table"))
Do Until rs.EOF
MsgBox rs.Collect("TABLE_NAME")
rs.MoveNext
Loop
Set rs = Nothing
cn.Close
Set cn = Nothing
thanks it works
is this working in ASP??
yes, i think it will work as long as you have the permission to access the xls file.
I am getting an error for adSchemaTables
hmmm.. i think you must define adSchemaTables in your include file. or you could just replace it with 20.
Yes it works thanks :thumb: