S
Stan Sainte-Rose
Hi
I have to import Excel file from ASP.
I do it well with the following code
Const adUseClient = 3
Const adClipString = 2
Const Repertoire = "w:\wwwroot\look\j_consultation\j06_suivi\modules_stan\"
Set adoCn = CreateObject("ADODB.Connection")
Set adoRs = CreateObject("ADODB.Recordset")
With adoCn
..Provider = "Microsoft.Jet.OLEDB.4.0"
..ConnectionString = _
"Data Source=" & Repertoire & "Essai.xls;" & _
"Extended Properties=Excel 8.0;"
..CursorLocation = adUseClient
..Open
End With
strQuery = "SELECT * FROM [CONTROLE INTERNE$]"
With adoRs
Set .ActiveConnection = adoCn
..Open strQuery
End With
My question is how to get the Sheet Tab Name.
Right now, with my code I have to write [CONTROLE INTERNE$]
but how to do when you don't know the name ?
Thanks for your help
Stan
I have to import Excel file from ASP.
I do it well with the following code
Const adUseClient = 3
Const adClipString = 2
Const Repertoire = "w:\wwwroot\look\j_consultation\j06_suivi\modules_stan\"
Set adoCn = CreateObject("ADODB.Connection")
Set adoRs = CreateObject("ADODB.Recordset")
With adoCn
..Provider = "Microsoft.Jet.OLEDB.4.0"
..ConnectionString = _
"Data Source=" & Repertoire & "Essai.xls;" & _
"Extended Properties=Excel 8.0;"
..CursorLocation = adUseClient
..Open
End With
strQuery = "SELECT * FROM [CONTROLE INTERNE$]"
With adoRs
Set .ActiveConnection = adoCn
..Open strQuery
End With
My question is how to get the Sheet Tab Name.
Right now, with my code I have to write [CONTROLE INTERNE$]
but how to do when you don't know the name ?
Thanks for your help
Stan