I am trying to export multiple MSAccess reports to one excel spreadsheet. I need the data in Excel for various reasons, and due to the formatting, it has to be from a report and not a query. Here is what I wrote in VB:
Dim xlApp As Excel.Application
Set xlApp = CreateObject(“Excel.Application”)
xlApp.Visible = True
xlApp.Workbooks.Open (“c:\test2.xls”)
DoCmd.OutputTo acOutputReport, “Docs”,_ acFormatXLS, xlApp
xlApp.Worksheets.Add
xlApp.Worksheets.Select (1)
DoCmd.OutputTo acOutputReport, “test”,_ acFormatXLS, xlApp2
xlApp.Workbooks.Close
Set xlApp = Nothing
The first report, “Docs” is transferred fine, into a worksheet called “Docs”. Worksheet 1 is then added and selected, but my second report “test” is not transferred. Any help would be appreciated.
Grant