Export from Access 2007 table to Excel 2007 triggers "External table is not in the expected format"
Posted on 2014-02-06
I have an Access 2007 app that runs automatically on a server and generates a number of reports based on data in an Access database. One of these reports is actually a simple export of one table with currently just under 17,000 rows and about 65 columns to an Excel 2007 (SP3) xlsx spreadsheet wich is generated in the process (i.e. it does not exist before the export).
Since a while, I get errors from time to time on that process. I am using DoCmd.TransferSpreadsheet, and after the first errors I changed the Excel type to acSpreadsheetTypeExcel12Xml, because other types gave me an error. For a while that worked well, but now, 2 days in a row, I got the "External table is not in the expected format" error. I am a bit puzzled as to what I should do. My export statement is:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "myTable", sOutputFileName
Even stranger is that, when in both error cases I ran the app again with breakpoints and executed the same statement by stepping it in Debug mode, it worked fine !
As I have read over the internet that some people say that there is a size limit to what can be imported in Excel with the current method, I'm a bit nervous, because the source table grows in number of rows every day, albeit very slowly.
Can you tell me:
- what could be wrong ?
- what can I do ?