locked
(RESOLVED) Addin ported to work with 2010, 2013, but fails in 2007 (modified with error details) RRS feed

  • Question

  • I have an addin which I ported to work with 2010 Office and 2013 Office, in Win7 and Win8. It works as expected.

    But it does not work in 2007 Office (Tried in Win7 32bit).

    Currently I built it using Visual studio 2010, with Office 2010 installed.  The addIn was built previously by Visual Studio 2008.

    1. The addin is detected by office 2007, and it comes up in add in's list, but comes up as an inactive add In.

    2. Re-Enabling does not work.

    3. I see no exceptions thrown when I enable the env variable "VSTO_SUPPRESSDISPLAYALERTS - 0".

    What could be the issue here? What steps should I follow to try and debug this?

    -

    Edit:

    We were able to get an exception caught in one of the systems. Following is a part of the exception.

    ---------------------------------------------------------

    Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.

    ************** Exception Text **************
    System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
    File name: 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
       at Microsoft.ExternalResearch.CreativeCommons.Excel.ThisAddIn.Initialize()
       at ....

    ************** Exception Text **************

    ..

    Edited:

    Now I have Narrowed down the issue. It is a problem of Installed version of 'Microsoft.Office.Interop.Excel' and so, in GAC being 12.0 assemblies, but what is being referenced is 14.0 assembiles (from the exception)! What do I need to modify such that my project uses the right assemblies?

    It is Kinda strange that the VSTO_SUPRESSDISPLAYALERTS environment variable did not work so many times when we tried on different environments, and eventually in one system it worked.

    ......

    Here is how I resolved this.

    In the system where it threw exception, from its details, i was able to solve this very quickly. Basically installed excel 2007 was with 12.0 interops and what was being referenced by my binaries were 14.0 interops. It worked in 2013 because of backward compatibility. So i had my project built on a system with Office 2007 and changed the references to refer to 12.0 interops and everything worked.

    • Edited by CrazyPlanet Thursday, January 10, 2013 5:43 PM
    Thursday, January 10, 2013 4:34 AM