How to instantiate Excel 2003 when both 2003 and 2007 are installe

G

Guest

I have both Excel 2003 (ver 11) and Excel 2007 (ver 12) installed on my
machine and I'm trying to instantiate Excel 11 app by doing

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

Despite the version specific progID, ver 12 application is instantiated.
Would anyone have suggeestions on instantiating an Excel 2003 instance
programmatically?

Any help is greatly appreciated.
 
J

JonOfAllTrades

Raghu said:
I have both Excel 2003 (ver 11) and Excel 2007 (ver 12) installed on my
machine and I'm trying to instantiate Excel 11 app by doing

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

Despite the version specific progID, ver 12 application is instantiated.
Would anyone have suggeestions on instantiating an Excel 2003 instance
programmatically?

Any help is greatly appreciated.

I've had that problem too, very maddening. My C# app specifically
references the 11 libs, because that's what everyone has, but at run time it
somehow decides it must have 12. The worst thing about it is that I somehow
got it to recognize the right libraries, months ago, but I had to reinstall
Office when it got damaged and now it's broken again.
 
J

JonOfAllTrades

Raghu said:
I've had that problem too, very maddening. My C# app specifically
references the 11 libs, because that's what everyone has, but at run time it
somehow decides it must have 12. The worst thing about it is that I somehow
got it to recognize the right libraries, months ago, but I had to reinstall
Office when it got damaged and now it's broken again.

OK, this is what I got to work: delete your existing Excel reference, and
add this (or equivalent on your machine):

C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Excel\11.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll

By referencing the 11.0 this way, it seems to stick to that version and not
switch to 12.0. Apparently it decided to change the 11 reference to 12 all
on its own when I reinstalled my software, but I've forced it back again.
This is a partial fix: on my computer, it STILL runs 12.0, but on other
machines with 11 installed but NOT 12, it runs the correct version. To put
it another way, it still uses the latest version, if available, but no longer
requires it.
Hope this helps!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top