Refer to a sheet in DoCmd.TransferSpreadsheet

  • Thread starter Thread starter dave
  • Start date Start date
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
 
Try this:

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