I am trying to use VBA to import an Excel file into access. And I am specifying a range, and specifying that it has headers.
This is the code that I have
Code:
Dim importFile As String
importFile = "C:\Test\test.xls"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, "Test", importFile, True, "A5:ZZZ99999999"
and the A5 - ZZZ99999 is just saying import all that because I have no idea where the data will actually end.
but I get an error of
Run-time error '3011':
The Microsoft access database engine could not find the object 'A5:ZZZ999999'. Make sure the object exists and that you pell its name and the path correctly