problem with working with excel files (as opposed to a spreadsheet saved as a csv or txt file) is that it can have multiple worksheets.
I think that code in the linnk WMIF posted is good if you know the worksheet nameas already (well...at least for the accepted answer) I haven't tried out that FSO method to find the name, but that may be what you need. Or even further down the post:
dim xlADOConn, rs, strFileName
strFileName = server.mappath("/myfile.xl
set xlADOConn = Server.CreateObject("ADODB
Call xlADOConn.Open("Driver={Mi
"DriverId=790;" & _
"Dbq=" & strFileName & ";")
Set rs = xlADOConn.OpenSchema(20)
if not rs.eof then
SheetName = rs("Table_Name")
end if
set rs = nothing
set xlADOConn = nothing
please no points for me...just pointing and elaborating a little on WMIF's post
Main Topics
Browse All Topics





by: WMIFPosted on 2006-11-03 at 12:36:53ID: 17869973
check out the answer in this question. it does what you need.
http:Q_21369273.html