Refer to a sheet in DoCmd.TransferSpreadsheet

D

dave

I need to import a spreadsheet to a temp file

My code is

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "tblTemp",
Me!tbxImportFileName, False, "A:F"

where tbxImportFileName is the name of the file.

This works fine, where the data to be imported is in the first sheet, but I
can't figure out how to refer to a sheet if it is not the first sheet.

Thnks
 
K

Ken Snell

Try this:

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "tblTemp",
Me!tbxImportFileName, False, "SheetName!A:F"
 

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