How do I correctly define the range in the transfer spreadsheet function. Here is what I have defined:
Sub TransExcel2Access()
'Import specified Excel worksheet / range of data
DoCmd.TransferSpreadsheet TransferType:=acImport, SpreadSheetType:=SpreadsheetTypeExcel9, _
Tablename:="TestImport2Access", fileName:="D:\Import\06022009\TestData.xls", _
Hasfieldnames:=False, Range:="Worksheet(1)(Data$)!A3161"
End Sub
The worksheet I need to import to Access is named "Data". I get the message stating - the Jet engine cannot find the object Worksheet(1)(Data$)$A3:161 - can someone help TIA
Sub TransExcel2Access()
'Import specified Excel worksheet / range of data
DoCmd.TransferSpreadsheet TransferType:=acImport, SpreadSheetType:=SpreadsheetTypeExcel9, _
Tablename:="TestImport2Access", fileName:="D:\Import\06022009\TestData.xls", _
Hasfieldnames:=False, Range:="Worksheet(1)(Data$)!A3161"
End Sub
The worksheet I need to import to Access is named "Data". I get the message stating - the Jet engine cannot find the object Worksheet(1)(Data$)$A3:161 - can someone help TIA