EzGoingKev
Registered User.
- Local time
- Today, 03:24
- Joined
- Nov 8, 2019
- Messages
- 199
I created a function to export five Access queries out into five sheets in the same Excel 2016 workbook using:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "QueryName", C:\Path\ExcelFileName, , "SheetName"
Sometimes I run it and it runs fine. It creates the workbook and makes all five sheets. No issues.
Other times I run it and get "Run-time error '3274': External table is not in the expected format." I hit debug and it usually chokes on exporting query two, three, or four (it varies). In these case it creates the workbook and exports whatever sheets up until it chokes.
Any ideas on why it runs fine sometimes and will not run successfully other times?
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "QueryName", C:\Path\ExcelFileName, , "SheetName"
Sometimes I run it and it runs fine. It creates the workbook and makes all five sheets. No issues.
Other times I run it and get "Run-time error '3274': External table is not in the expected format." I hit debug and it usually chokes on exporting query two, three, or four (it varies). In these case it creates the workbook and exports whatever sheets up until it chokes.
Any ideas on why it runs fine sometimes and will not run successfully other times?