Send a report to Excel

  • Thread starter Secret Squirrel
  • Start date
S

Secret Squirrel

How do I write code to export a report to excel? I have a command button on a
form that runs the report to excel but it's using a macro. How do I change
this so I don't have to use a macro?
 
D

Dennis

In the on click event of the button, change the macro name to Event
procedure. Then click on the 3 elispses buttons at the side and this will put
you into the VBA code editor for the click of the button.
Enter code similar to this

Docmd.OutputTo acOutputReport,"ReportName",acFormatXLS,
"C:\Temp\FileName.xls"
 
Top