-
January 4th, 2006, 01:05 AM
#1
Getting the shett list of excel file
Hi All,
How can I get the list of sheets of a given excel file
-
January 4th, 2006, 01:12 AM
#2
Re: Getting the shett list of 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
Busy
-
January 4th, 2006, 01:38 AM
#3
Re: Getting the shett list of excel file
thanks it works
is this working in ASP??
-
January 4th, 2006, 02:09 AM
#4
Re: Getting the shett list of excel file
yes, i think it will work as long as you have the permission to access the xls file.
Busy
-
January 4th, 2006, 02:12 AM
#5
Re: Getting the shett list of excel file
I am getting an error for adSchemaTables
-
January 4th, 2006, 02:28 AM
#6
Re: Getting the shett list of excel file
hmmm.. i think you must define adSchemaTables in your include file. or you could just replace it with 20.
Busy
-
January 4th, 2006, 04:32 AM
#7
Re: Getting the shett list of excel file
Yes it works thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|