Export automatically (2 Viewers)

krc547

Member
Local time
Today, 14:26
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?
 

Ranman256

Well-known member
Local time
Today, 15:26
Joined
Apr 9, 2015
Messages
4,337
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:26
Joined
Oct 29, 2018
Messages
21,474
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:

krc547

Member
Local time
Today, 14:26
Joined
Sep 1, 2023
Messages
38
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

Top Bottom