Reputation: 1342
My PC has both Excel 2003 and 2007 as well as the Excel 2007 compatibility pack installed, it also has a VB script that build records into an csv file automatically. Recently, the number of records that are needed to dump into the file has grown significantly and went beyond the row limit in Excel 2003. As such, I made a copy of the same file and saved it into .xlsm format. However, when I use the VBScript to run the macro behind the Excel spreadsheet by calling:
Set myApp = CreateObject("Excel.Application")
The Excel file still attempted to open itself to convert (using the compatibility pack) to Excel 2003 and run in Excel 2003, which inevitably gives an error every time it runs.
Is there any way I could force Excel.Application to point to Excel 2007 instead of Excel 2003?
Thanks!
Upvotes: 3
Views: 6393
Reputation: 36
I had a similar experience, I am running office 2010 and i want to use the Office agents available until Office 2003. so I installed Excel 2003 on my box and i didnt worked.
I found this post and tried all options. reaseaching i found that i should use:
Set myApp = CreateObject("Excel.Application.11")
for office 2003 but it didnt work.
All my testing was done in VBSedit software, which shows that it was using the office 2003, but it was actually opening 2007.
I tried with primalscript
and is working like a charm.
I think this might help others.
Upvotes: 2
Reputation: 2785
see http://support.microsoft.com/kb/292491
there: For testing purposes, developers can force a specific version of an Office application to register by using the /regserver switch on the command line. For example, to force an Excel version to register without running setup, you can use a command line that resembles the following:
"c:\program files\microsoft office\office\excel.exe" /regserver
Upvotes: 1