We help IT Professionals succeed at work.

Trying to export a report to an Excel file.

SteveL13 asked
I have a report that I am trying to export to an Excel file but no matter what I try, the information doesn't come over correctly.  Anyone have any thoughts?
Watch Question

Owner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010
how are you doing it?

Have you considered simply exporting the query that the report is based upon?
William FulksIT Services Analyst

We need a little more info to help you with this.

What's not coming over correctly? Is it giving you errors or just generating junk data?
John TsioumprisSoftware & Systems Engineer
Distinguished Expert 2019
If it's formatting issue then maybe you need Excel automation to format the output to match the report


John, what is Excel automation?
Distinguished Expert 2017
OLE automation is writing VBA code in Access to manipulate the spreadsheet.  Doing this requires knowledge of the Excel object model.  If you do not understand the Excel object model, you might be able to get Excel to help you.  Export the query used as the recordsource for the report to Excel.  Open the workbook and turn on the macro recorder.  Format the data so it has the totals and breaks you want.  Close the macro recorder and copy the generated VBA code into Access.  You will need to modify it to some degree because the object references are different from Access to Excel than internally inside Excel.  But with some knowledge of VBA, you should be able to get this to work.