ADO Recordset
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 |
All times are GMT +1. The time now is 03:58 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com