Export automatically

krc547

Member
Local time
Today, 17:30
Joined
Sep 1, 2023
Messages
38
Is there a way to get a report to export automatically to excel when the report is closed? Or is there a way instead of viewing it to automatically export it to excel?
 
reports print to paper. You can 'export' them to PDF.

do you mean export the data query into excel?
if so:
vFile = "c:\temp\MyFile.xlsx"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12xls, "qsMyQuery", vFile, True
 
Hi. Welcome to AWF!

Reports don't usually come out as nice looking in Excel as they do on the Report. If you just want the raw data in Excel, you can export the data source instead.
 
Last edited:
reports print to paper. You can 'export' them to PDF.

do you mean export the data query into excel?
if so:
vFile = "c:\temp\MyFile.xlsx"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12xls, "qsMyQuery", vFile, True
Oh that makes sense. Thank you
 

Users who are viewing this thread

Back
Top Bottom