RunCommand OutputToExcel fails on Access 2007 SP2
Issue
When running a macro to export a report to Excel format using "RunCommand OutputToExcel" the following error occurs:
"The format in which you are attempting to output the current object is not available. Either you are attempting to output the current object to a format that is not valid for its object type, or the formats that enable you to output data as a Microsoft Excel, rich-text format, MS-DOS text, or HTML file are missing from the Windows Registry. Run Setup to reinstall Microsoft office Access or, if you're familiar with the settings in the Registry, try to correct them yourself. For more information on the Registry, click Help."
According to the article
http://support.microsoft.com/kb/934833 it appears this issue should have been resolved by Office 2007 SP2.
Resolution
Instead of using the RunCommand use OutputTo:
OutputTo Report, , Excel 97 - Excel 2003 Workbook (*.xls), , Yes, , 0, Print
References
Products
Microsoft Access 2007 SP2
Created: 14th July 2009
Updated: 14th July 2009
© 2005-2024 Jamie Morrison