Jsncrdnl
Jsncrdnl

Reputation: 3075

Compatibility between MS Office Excel 2007 & 2010 Add in

I'd like to know if there's any way to develop, in example, an Excel add in for office 2007 that will work on office 2010? (Or a 2010 add in on 2007)

How should I do that? Have you got some examples / sources?

Upvotes: 4

Views: 2624

Answers (1)

Denys Wessels
Denys Wessels

Reputation: 17039

Have a look at this MSDN article Running Solutions in Different Versions of Microsoft Office

Basically what Microsoft say is that this is possible PROVIDED the features you use in your add-in work in both 2007 and 2010 versions of your office program(in your case Excel)

I'm not sure as to the scale of the project you're trying to build but from personal experience I always had to create two separate versions of the add-in to target 2007 and 2010 versions of Office

Just found out that you can get the Version number from the Application object. I haven't had time to play around with this but I assume that you can use below in cases where the 2010 code is incompatible with 2007 and execute code for the appropriate version:

    Microsoft.Office.Interop.Excel.Application app = Globals.ThisAddIn.Application;
    string version = app.Version;

    if (version == "14.0")
    {
        //If Excel 2010 do something
    }
    else if (version == "12.0")
    {
        //If Excel 2007 do something else
    }

Upvotes: 3

Related Questions