dannydanny
IS-IT--Management
Hi,
I know about the docmd.outputTo code to export a table to an Excel file. However I would like to export multiple tables to a single Excel file, with each table represented on different Excel Worksheets. Is this possible in Access 97? I suspect it might take some complex VBA coding in Access, using the Excel application object, but I am hoping that there is a more simple and elegant solution....
If I use multiple docmd.outputTo commands for each table, the Excel file just contains the table from the last command. e.g.
**********************************
sub ExportToExcel()
DoCmd.OutputTo acOutputTable, "myTable1", acFormatXLS, "c:\test.xls"
DoCmd.OutputTo acOutputTable, "myTable2", acFormatXLS, "c:\test.xls"
end sub
*********************************
The Excel file would only have the myTable2 data.
Thanks for any info,
Danny.
I know about the docmd.outputTo code to export a table to an Excel file. However I would like to export multiple tables to a single Excel file, with each table represented on different Excel Worksheets. Is this possible in Access 97? I suspect it might take some complex VBA coding in Access, using the Excel application object, but I am hoping that there is a more simple and elegant solution....
If I use multiple docmd.outputTo commands for each table, the Excel file just contains the table from the last command. e.g.
**********************************
sub ExportToExcel()
DoCmd.OutputTo acOutputTable, "myTable1", acFormatXLS, "c:\test.xls"
DoCmd.OutputTo acOutputTable, "myTable2", acFormatXLS, "c:\test.xls"
end sub
*********************************
The Excel file would only have the myTable2 data.
Thanks for any info,
Danny.