TransferSpreadSheet Question

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
 
K

Ken Snell [MVP]

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top