VB Script - Calling Excel 2007 explicitly when Excel 2003 and Excel 2007 are installed

My computer has both Excel 2003 and 2007, as well as the Excel 2007 compatibility package, it also has a VB script that automatically writes entries to the csv file. Recently, the number of records needed to create a dump in a file has grown significantly and goes beyond the line limit in Excel 2003. Thus, I made a copy of the same file and saved it in .xlsm format. However, when I use VBScript to run a macro behind an Excel table, calling:

Set myApp = CreateObject("Excel.Application")

The Excel file was still trying to open itself for conversion (using the compatibility pack) to Excel 2003 and run in Excel 2003, which inevitably gives an error every time it starts.

Is it possible to force Excel.Application to specify Excel 2007 instead of Excel 2003?

Thank!

+3
source share
3 answers

I had a similar experience, I work in the office of 2010, and I want to use Office agents available before Office 2003. so I installed Excel 2003 on my mailbox and I did not work.

I found this post and tried all the options. reaseaching I found that I should use:

Set myApp = CreateObject("Excel.Application.11") 

for office 2003, but it didn’t work.

All my tests were performed in VBSedit software, which shows that it used office 2003, but actually it was the opening of 2007.

I tried with primalscriptand worked like a charm.

I think this can help others.

+2
source

Try:

Set myApp = CreateObject ("Excel.Application.12")

+1

. http://support.microsoft.com/kb/292491

yes: For testing purposes, developers can force registration of a specific version of the Office application using the / regserver switch on the command line. For example, to force the version of Excel to register without starting the installation, you can use a command line that resembles the following:

"c: \ program files \ microsoft office \ office \ excel.exe" / regserver

+1
source

Source: https://habr.com/ru/post/1795866/


All Articles