Shane Groff
A simple report does work.
Here is the code snippet I'm using to generate the reports. It generates blank .xlxs files.
'Trigger Open Report event
DoCmd.OpenReport ExpRpt, acViewPreview
DoCmd.OutputTo acOutputReport, , acFormatPDF, outfile & rs.Fields(0).Value & ".pdf", False, , , acExportQualityPrint
DoCmd.OutputTo acOutputReport, , acFormatXLSX, outfile & rs.Fields(0).Value & ".xlsx", False, , , acExportQualityScreen
DoCmd.Close acReport, ExpRpt, acSaveNo
Here is the code snippet I use that works perfectly with .xls files.
'Trigger Open Report event
DoCmd.OpenReport ExpRpt, acViewPreview
DoCmd.OutputTo acOutputReport,, acFormatPDF, outfile & rs.Fields(0).Value & ".pdf", False, , , acExportQualityPrint
DoCmd.OutputTo acOutputReport,, acFormatXLS, outfile & rs.Fields(0).Value & ".xls", False, , , acExportQualityScreen
DoCmd.Close acReport, ExpRpt, acSaveNo
Changing the code to:
'Trigger Open Report event
DoCmd.OpenReport ExpRpt, acViewPreview
DoCmd.OutputTo acOutputReport, ExpRpt, acFormatPDF, outfile & rs.Fields(0).Value & ".pdf", False, , , acExportQualityPrint
DoCmd.OutputTo acOutputReport, ExpRpt, acFormatXLSX, outfile & rs.Fields(0).Value & ".xlsx", False, , , acExportQualityScreen
DoCmd.Close acReport, ExpRpt, acSaveNo
makes no difference.