Hi,
I'm an accountant by trade, not a programmer, so I didn't quite understand the whole thread. But I have a similar problem. I managed to create the following VB code that extracts my multiple tables to one Excel File:
Public Sub ExportTblToExcel()
strFullPath = "C:\Documents and Settings\dupuism3\Desktop\Details.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "A561_All", strFullPath, False
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "A561_DG", strFullPath, False
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "A561_NCASS", strFullPath, False
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "A561_OSS", strFullPath, False
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "A561_PTPS", strFullPath, False
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "A561_RPT 1", strFullPath, False
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "A561_RPT 2", strFullPath, False
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "A561_RPT 3", strFullPath, False
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "A561_RPT 4", strFullPath, False
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "A561_TAS", strFullPath, False
End Sub
However, I can't seem to be able to run it from the Access Macro using the "Runcode" command. I've done some research, and read that the "Runcode" command will only run Function procedures and that I have to write my Sub procedure as a Function procedure - except that none of the literature I've seen tells me how to do this.
Thank you.