I have the following code (that used to work fine). It is giving me an error - external table is not in the expected format. All I am doing is exporting the queries to an Excel workbook.
Private Sub Expqueries2_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "03_CntByProduct_CompPPO2", "V:\CORPDATA17\Admin\Linda\DelawareReportExcelFolder\MyWorkbook2.xlsx", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "03_CntByProduct_BlueCare2", "V:\CORPDATA17\Admin\Linda\DelawareReportExcelFolder\MyWorkbook2.xlsx", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "03_CntByProduct_First State Basic PPO2", "V:\CORPDATA17\Admin\Linda\DelawareReportExcelFolder\MyWorkbook2.xlsx", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "03_CntByProduct_CDHGold2", "V:\CORPDATA17\Admin\Linda\DelawareReportExcelFolder\MyWorkbook2.xlsx", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "03_CntByProduct_Medicfill2", "V:\CORPDATA17\Admin\Linda\DelawareReportExcelFolder\MyWorkbook2.xlsx", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "03_CntByProduct_POS2", "V:\CORPDATA17\Admin\Linda\DelawareReportExcelFolder\MyWorkbook2.xlsx", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "03_CntByProduct_All2", "V:\CORPDATA17\Admin\Linda\DelawareReportExcelFolder\MyWorkbook2.xlsx", True
MsgBox "All reports have been exported to Excel.", vbInformation
End Sub
Macro error
-
- Administrator
- Posts: 78493
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- Administrator
- Posts: 78493
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Macro error
If the first one works, there may be something wrong with the second query you're trying to export, 03_CntByProduct_BlueCare2. Can you open this query without problems?
Best wishes,
Hans
Hans