Print View

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

RunCommand Macro Action
http://office.microsoft.com/en-us/access/HA012262811033.aspx?pid=CH100728921033
"When you convert an Access database from a previous version of Access, some commands may no longer be available. A command may have been renamed, moved to a different menu, or may no longer be available in Access"

Unless you install the Office 2007 suite Service Pack 2, you cannot export a report to an Excel format in Access 2007
http://support.microsoft.com/kb/934833

Products

Microsoft Access 2007 SP2

Created: 14th July 2009
Updated: 14th July 2009

Print View

© 2005-2024 Jamie Morrison