Quick draw, untested but should work with some tweaking:
Code:
Private Sub btExportReportToXls_Click()
Dim XlsName As String
Dim XlsFullPath As String
Dim ReportName As String
ReportName = "repToExport"
DoCmd.OpenReport ReportName, acViewPreview, , , acHidden 'opens report preview, required for export
XlsName = "ExportedReport" ' file name of your exported xls
XlsFullPath = Application.CurrentProject.Path & "\XLS\" & XlsName & ".xls" 'full path to above file
DoCmd.OutputTo acOutputReport, ReportName, acFormatXLS, XlsFullPath 'export command
DoCmd.Close acReport, ReportName, acSaveNo 'close report preview back
End Sub
That should work but personally I don't think exporting report to Excel format is the best idea. Maybe you'd consider exporting query results?