I use below code to generate a Excel file for client A123 statement.
The Excel file is exported.
But cannot open with message "File format or file extension is not valid"
Do I need to remove the statement's header and just leave the detail section ?Code:DoCmd.OpenReport "rptStatement", acViewPreview, , "CustNo='A123'", acHidden DoCmd.OutputTo acOutputReport, "rptStatement", acFormatXLS, "C:\Temp\A123Statement.xlsx"
Thanks