View Full Version : Exporting Multipage Report From Access to Excel
cbeltrante
12-21-2006, 05:42 AM
Hello,
I'm using code to export a multiple page MS ACCESS report to Excel. The problem I'm having is that it exports into 2 or 3 or more different workbooks because of the multiple pages.
Is there any work around to resolve this problem???
Thanks,
Chris
Is there a special reason for using the Report to output to Excel, if you just need the data you can output a Query in to 1 Excel Sheet?
When you exported the Report did you specify the Worksheet Name?
If you did you should only get one Workbook
cbeltrante
12-21-2006, 07:51 AM
Looking at the code, they're using the "OutputTo Method" in MS Access with a template created.
The reason is that most of the calculations are being done on the report with grouping and total sums.
cbeltrante
12-28-2006, 06:58 AM
Does anyone know of a fix to my problem?? I still haven't found the answer yet. Thanks!!!
cbeltrante, is a single worksheet Name specified in the Docmd.OutputTo?
cbeltrante
12-28-2006, 10:34 AM
Yes, here's the code:
We're using a table that has the report names and their suffixes in it.
strDocName = rs("ReportName")
strExportName = rs("ExportName") & "." & rs("Format")
strFileName = Me.txtReportFolder & "\" & strExportName
DoCmd.OutputTo acReport, strDocName, acFormatHTML, strFileName, , strTemplate
cbeltrante, please note that the output Format is acFormatHTML and for Excel it should be acFormatXLS.
Also the Export name should be
strExportName = rs("ExportName") & ".xls"
The extension that you currently have looks as if it is "setable" by the User, using rs.("Format")
cbeltrante
12-28-2006, 12:59 PM
The extension is set in the table and it has an .xls extension.
They want to have it as HTML report within an xls spreadsheet.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.