T
Tim
Hi folks,
I used the following code to create ado recordset. It works but it aslo
opens another excel file. Is it possible to create ado recordset without
open a new excel instance? Or can I use currentproject.connection?
Thanks in advance.
Tim.
Sub ConnectToExcelUsingSheetName ()
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\fsADOConnectExcel.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes"";"
rst.Open "SELECT * FROM [Staff List$];", cnn, adOpenStatic, adLockReadOnly
I used the following code to create ado recordset. It works but it aslo
opens another excel file. Is it possible to create ado recordset without
open a new excel instance? Or can I use currentproject.connection?
Thanks in advance.
Tim.
Sub ConnectToExcelUsingSheetName ()
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\fsADOConnectExcel.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes"";"
rst.Open "SELECT * FROM [Staff List$];", cnn, adOpenStatic, adLockReadOnly