maephisto
maephisto

Reputation: 5182

Upgrade to Excel 2007 - app still uses 2003 interop

I have a windows forms application that uses excel to generate some reports. Untill now it used 2003 but i've made an upgrade to use 2007. I have installed on my machine 2003, 2007 and 2010, and my app references Microsoft.office.core, v 12.0 and microsoft.office.interop.excel v 12.0. But in my code, when i do :

using Excel = Microsoft.Office.Interop.Excel;
......
Excel.Application excelApp = new Excel.Application();
string v = excelApp.Version;

v will be 11.0 . Also, the path references

C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\14.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll

How can this happen? Any ideea how could i fix it ?

Thank you!

Upvotes: 1

Views: 878

Answers (2)

cookieMonster
cookieMonster

Reputation: 597

I've seen this topic lately, maybe it would be useful for you too: Trying to do Office Automation with Excel 2007, but keeps using Excel 2003.

Upvotes: 1

gawicks
gawicks

Reputation: 1964

You shouldn't keep both versions (at least on your dev machine).On your clients machine it shouldn't be a problem . Normally in this situation your code should load the 2007 PIAs. I suggest that you should do a repair . Or do a complete fresh install of 2007.Or fiddle wth the registry and set the active version to 12 (which I don't recommend)

Upvotes: 2

Related Questions