Take a look at this MSDN article Running Solutions in Different Versions of Microsoft Office
Basically, Microsoft says that itβs possible PROVIDED functions that you use in your add-in work in versions of your office program 2007 and 2010 (in your case, Excel)
I'm not sure about the scale of the project you are trying to build, but from personal experience I always had to create two separate versions of the add-in for the target versions of Office
2007 and 2010 years.
It just turned out that the version number can be obtained from the Application object. I did not have time to play with this, but I assume that you can use below in cases where the 2010 code is incompatible with 2007 and runs the code for the corresponding 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 }
source share