none
Conflict between visual studio 2010 tools for office runtime and visual studio tools for office runtime 3.0 RRS feed

  • Question

  • Hi,

    I have developed an Application level Addin using VS 2008 and VSTO 3.0 with Excel 2007. I was able to deploy it on lot of machines and it works fine. But due to some upgrades in our company, some of the users are having either Visual Studio Team Explorer 2010 or MS Access 2010 or MS Visio 2010 installed on their machines. This is conflicting with VSTO 3.0. And this is causing my Addin to crash. Even though my Addin shows up in the list of Active Addins, it never gets loaded and does not show up in Excel. When i unsinstall the above said softwares, then my Addin starts showing up.

    I think the reason for this is the Conflict between visual studio 2010 tools for office runtime and visual studio tools for office runtime 3.0. Can someone please suggest if this is the cause and if it is, then what can be done to load my Addin even if the machine has visual studio 2010 tools for office runtime installed.

    Thanks.

    Tuesday, June 19, 2012 6:52 PM

Answers

  • can you add some logging to your add-in startup routine so we can be sure it is loaded properly? Also please add try/catch block there so no exceptions escape.
    • Marked as answer by Shailendra_G Tuesday, August 21, 2012 3:12 PM
    Friday, August 17, 2012 6:16 PM
  • Finally i figured out the issue. There were couple of them.

    Firstly i was getting error at the following line... which was working in my other version. So i had to remove this line.

    cellRightClickInsertButton = (Office.CommandBarButton)cb.FindControl(missing, 3181, missing, missing, true);

    Then secondly i was getting error at the following line.

    ConfigurationManager.AppSettings["ExcelAddinVersion"];

    For some reason it is not able to read information from the config file. I changed this code to use Resource file and i have no issue now.

    So my install is working fine now. Thanks for your help.

    • Marked as answer by Shailendra_G Tuesday, August 21, 2012 3:12 PM
    Tuesday, August 21, 2012 3:12 PM

All replies

  • only one vsto engine can be active at any time, so if those apps install vstor 2010, then it will be responsible for loading your add-in. however vstor2010 should be able to load your add-in without any problem. can you set up VSTO_SUPPRESSDISPLAYALERTS envi variable to 0 and try to load your add-in after office restart?
    Tuesday, June 19, 2012 7:09 PM
  • I did try setting the environment variables, but i did not see any messages coming up. I also set the option of "Show Add-In user interface errors", but still see no messages.
    Tuesday, June 19, 2012 7:22 PM
  • just to be sure - when installing apps from office 2010, your excel app stays 2007?

    Tuesday, June 19, 2012 7:27 PM
  • Yes ... Excel is still 2007. The only apps that might get installed are Access 2010, Visio 2010, Visual Studio Team Explorer or TFS or VS 2010. These are the apps that i have seen getting installed and the version of Excel, Word and Powerpoint still remains 2007.
    Tuesday, June 19, 2012 8:00 PM
  • VSTO 4.0 should be backwards compatible.

    However, have you seen this thread?

    Tuesday, June 19, 2012 10:27 PM
  • network location could be one of trails, but there is still another: altough you can have side by side installed office apps from different versions (like excel 2007 and excel 2010) only latest suite will be able to load add-ins developed using vsto is this is by design. So Team explorer and tfs are not a part of office suite, but access sure is, so i guess this may be the case.
    Wednesday, June 20, 2012 7:59 AM
  • So after going through the thread, i can think of an option. I am planning to upgrade my Visual Studio to 2010 from 2008 and then add VSTO 4.0 as pre-requisite instead of VSTO 3.0 and develop the Addin for Office 2007.

    Can you please suggest if this will work .... so then i really dont have to deal with any upgrades to office components.

    Wednesday, June 20, 2012 3:15 PM
  • Network location is not an issue here as my Addin is deployed locally on each machine along with the pre-requisites. And also we never have two versions of the same components installed. Like for example we never have Excel 2007 and Excel 2010 installed. We might have Excel 2007 with Access 2010 or something similar to this. The Team explorer and TFS are 2010 versions. That is the reason i suspected that they might have something to do with my issue.
    Wednesday, June 20, 2012 3:19 PM
  • no, if this is a case that i described, vsto version changes nothing, only latest suite of office apps will be able to load vsto-based add-ins. So if you have some 2007 and 2010 office apps mixed on single machine, only the latter will load your add-ins, disregarding which VS you used to develop them.
    Wednesday, June 20, 2012 3:26 PM
  • So if that is the case .. then can i use VSTO 4.0 to develop my Addin instead of VSTO 3.0.

    I am not even sure if this can be done ... Please let me know of any other possibilities.

    Wednesday, June 20, 2012 3:30 PM
  • again, assuming that this is a case that i described (and we do not know it yet) - this is by design and cannot be circumvented. maybe add-ins written in native languages like c++ or vb6 are not subjects to that design decision. Can someone with more knowledge about that chime in?

    Wednesday, June 20, 2012 6:32 PM
  • Sorry for such a delayed reply.... It really took a while for me to get a machine with Visual Studio 2010 Installed along with Office 2007. And after so much time and effort, I build my solution with Microsoft Visual Studio 2010, Office 2007 and Visual Studio 2010 Tools for Office Runtime. But when i deploy this on a machine, the Addin fails to Load properly. When i look in the Excel Options -> Addins, it shows up in the Active Addins list but does not show up in the Ribbon.

    Can someone please suggest how to make my addin work with Visual Studio 2010 Tools for Office runtime.

    Thanks

    Friday, August 17, 2012 4:36 PM
  • can you add some logging to your add-in startup routine so we can be sure it is loaded properly? Also please add try/catch block there so no exceptions escape.
    • Marked as answer by Shailendra_G Tuesday, August 21, 2012 3:12 PM
    Friday, August 17, 2012 6:16 PM
  • When i enabled the "show Addi-in user interface errors" option, i got an error message "The call to GetCustomUI() for RibbonID Microsoft.Excel.Workbook failed".  I try to search for this error .. but i am not getting proper information on why we get this error.
    Monday, August 20, 2012 3:31 PM
  • maybe your returned xml is not valid? show us your ribbon xml
    Tuesday, August 21, 2012 8:04 AM
  • I agree with Damien. That suggests a specific problem with the AddIn, rather than the VSTO version.

    If it works on a development machine, it may be that it's not configured to load the XML from a resource. This is normally handled by VSTO automatically, but it's possible you've modified it. Here are a couple of VSTO-generated things, within the ribbon class, which you ought to check are still present:

    By default there's a 'Helpers' region, and inside that a GetResourceText method. Have you modified that?

    There's also a 'Callbacks' region, and should be something like:

    public void Ribbon_Load(Office.IRibbonUI ribbonUI)
    {
        this.ribbon = ribbonUI;
    }

    (And this method ought to be called by your XML).

    Finally, still in your Ribbon class, there ought to be:

    public string GetCustomUI(string ribbonID)
    {
        return GetResourceText("WordAddIn3.Ribbon1.xml"); // Resource name
    }

    Tuesday, August 21, 2012 9:57 AM
  • Finally i figured out the issue. There were couple of them.

    Firstly i was getting error at the following line... which was working in my other version. So i had to remove this line.

    cellRightClickInsertButton = (Office.CommandBarButton)cb.FindControl(missing, 3181, missing, missing, true);

    Then secondly i was getting error at the following line.

    ConfigurationManager.AppSettings["ExcelAddinVersion"];

    For some reason it is not able to read information from the config file. I changed this code to use Resource file and i have no issue now.

    So my install is working fine now. Thanks for your help.

    • Marked as answer by Shailendra_G Tuesday, August 21, 2012 3:12 PM
    Tuesday, August 21, 2012 3:12 PM