
I hope that helps your Excel connection issue.Īs a final comment I have to say that if you are doing something that takes "several seconds" to do in Excel but "takes around 20-25 min" to do in Access then I strongly suspect that you are using Access in a very inefficient way, but that's a topic for another question (if you care to pursue it). The results were C:\Users\Gord\Documents\_tmp>cscript /nologo excelTest.vbsĭata row 1, rst("LastName").Value="Thompson"

Wscript.Echo rowCount & " data rows found." Wscript.Echo "Data row 1, rst(""LastName"").Value=""" & rst("LastName").Value & """" Set rst = CreateObject("ADODB.Recordset") Set con = CreateObject("ADODB.Connection") and then ran the following VBScript to test the connection: Option Explicit To test, I created a User DSN named "odbcFromExcel" that pointed to that workbook. The most straightforward way is to keep the data on a separate sheet, put column names in the first row (starting in cell A1), and then have the actual data start in row 2, like this They are explained in detail in the "Select Excel Data with Code" section of the Microsoft Knowledge Base article 257819. An unnamed range of cells on a worksheet.

There are several ways you can reference "table" data in an Excel workbook:
