How do I script to export a table to excel

  • Thread starter Thread starter Guest
  • Start date Start date
Take a look at the following method: DoCmd.TransferSpreadsheet

Following example copies the table to a spreadsheet:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
"qryName", strFileName, True

where "qryName" is a string corresponding to a query that bounds the scope
and order of the data to be transferred, and strFileName is a sting
containing the complete path and name of the Excel file to be saved.
 
Back
Top