Exporting to a specific worksheet

  • Thread starter Thread starter pcamrass
  • Start date Start date
P

pcamrass

How do I specify a specific worksheet in the file path name of
workbook when using an Access Macro to export to excel?

thx.......p
 
In Access, use the TransferSpreadsheet method to send the data, either
by creating a macro, or writing some code. You can name a range in the
worksheet, and paste there. In this example, Sheet2!A1 is named "PasteHere":

'======================
Sub SendTableToExcel()
DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "tblCustomers", _
"c:\Data\MyExcelFile.xls", True, "PasteHere"
End Sub
'===========================
 
Back
Top