Macro to EXPORT to Excel

TimE

Registered User.
Local time
Today, 07:30
Joined
May 17, 2005
Messages
55
I would like to create a command button to export a query or report to excel. Is this possible and if so, how?


Thanks in advance for any assistance.
 
The following code will export a query to an excel sheet.

Code:
Sub export_to_excel()
Dim mfile
myfile = "Your path name/spreadsheet name.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "your query name", myfile
End Sub()

Hay
 

Users who are viewing this thread

Back
Top Bottom