TransferSpreadSheet Question

  • Thread starter Thread starter Joe Delphi
  • Start date Start date
J

Joe Delphi

Hi,

I want to transfer data from an MS Excel workbook containing two
worksheets. In the example below, I am attempting to transfer the data
from the first worksheet which is named NSR. I am attempting to use the
range argument of the TransferSpreadsheet command to specify the worksheet,
but Access is complaining that it is not valid.

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9,
"tlkpPayScheduleNSR", Filepath & "\200507 Pay Schedules", True,
"[NSR]!A1:F66"


Anyone know how to specify the worksheet and range in an Excel workbook
file?


JD
 
Drop the [ ] around the NSR, and include the file extension in the filename:

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9,
"tlkpPayScheduleNSR", Filepath & "\200507 Pay Schedules.xls", True,
"NSR!A1:F66"
 
Back
Top