none
VSTO Add-In works fine in Word 2013 and Word 2010, but won't load in Word 2007 RRS feed

  • Question

  • I'm new to C# and .NET and this is my first real project.  I wrote an Add-In in Visual Studio 2013 using the Word 2013 Add-In template.  I followed the instructions at http://msdn.microsoft.com/en-us/library/cc442767.aspx to create an InstallShield installer.  I have successfully tested the installer on workstations running Office 2013 and Office 2010, but I can't get it to load in Office 2007. I added the VSTO_SUPPRESSDISPLAYALERTS environment variable, but I don't think that the Add-In even attempts to load because I don't see any messages and the Load Behavior in the COM Add-Ins dialog just says "Unloaded" and nothing else.  I try to check the box, but as soon as I go back in, the box is no longer checked.  I have checked the registry and the LoadBehavior is still set to 3.  The Add-In isn't in the disabled list either.  As far as I can tell, the Add-In hasn't ever attempted to load.  I have tried on two separate machines running different operating systems, but I get the exact same behavior.  The installer installed Visual Studio 2010 Tools for Office Runtime and I was under the impression that was compatible with Office 2007- 2013.  Is there something that I am missing?  I haven't been able to find any forum posts describing the same behavior I am seeing.  The most similar ones I have seen were disabled, but mine is not.  I'm not sure what to check next.  I would greatly appreciate some suggestions.


    Friday, October 31, 2014 11:20 PM

Answers

  • So, I finally figured it out.  My Add-In now installs for all users and can run in Office 2007-2013.  It turns out that I needed to add the registry key mentioned in "https://support.microsoft.com/kb/976811" in both the 32-bit and 64-bit sections of the registry in my installer.  I didn't need to apply the hotfix because it was included in one of the Windows Updates for Office 2007.  I tried entering that registry key before, but I entered it manually on the machine that I was testing and forgot to enter it in the 64-bit section.

    So, all I needed to do was enter the EnableLocalMachineVSTO registry entry in both the SOFTWARE (32-bit) and SOFTWARE (64-bit) sections of the registry, along with the normal Addins registy entries, in my InstallShield installer.  It was just weird that the Add-In would install and be listed as an Add-In in Word, but would never load until I added those registry items.

    Thank you for your help Fei.  I appreciate your responses.



    • Marked as answer by snake14usa Wednesday, November 5, 2014 6:53 PM
    • Edited by snake14usa Wednesday, November 5, 2014 6:57 PM
    Wednesday, November 5, 2014 6:53 PM

All replies

  • Hi,

    Thanks for posting in MSDN forum.

    Based on the description, the add-in worked for Office 2010 and 2013 but didn't work in Office 2007. I would like to know whether there is the code in startUp event? Or does the add-in could be loaded when you create a new empty project?

    If yes, I suggest that you check the code to see whether it use the feature provided by Office 2010. You can get more detail about running solutions in defferent versions of Office from link below:
    http://msdn.microsoft.com/en-us/library/bb772080.aspx

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, November 3, 2014 2:48 AM
    Moderator
  • I don't have any code in the Startup method of the add-in.  I do have some code in the Load method of the Ribbon, but I'm just attaching a few listeners.  That should be fine for Office 2007 shouldn't it?  I even tried commenting out the code in the Ribbon's Load method and I still see the same behavior in Word 2007.  I tried putting a MessageBox in the Startup method of the Add-In, but it never displays.  I don't think that Word even attempts to load the Add-In for some reason and I'm not sure why.
    Monday, November 3, 2014 5:31 PM
  • Hi Snake,

    Thanks for your detail information for this issue. To troubleshot this issue, we can set the VSTO_SUPPRESSDISPLAYALERTS" environment variable to 0. Then go back to the registry key and set the LoadBehavior to 3. Now restart the Excel.

    Please refer to the article below for the detail steps:My Office Addin does not Load!

    I also would like to know, is there any VSTO add-in working on the computer which installed Office 2007? If there is no other add-in, would you mind creating an new empty project and deploy it to the issue machine. It is helpful for us to narrow down the issue cause by code or the environments of machine.

    Hope it is helpful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 4, 2014 5:43 AM
    Moderator
  • Thank you for your recommendations.  I already tried setting the VSTO_SUPPRESSDISPLAYALERTS environment vairable to 0 and made sure that the option in Word was set to display Add-In error messages, but nothing displayed.  I have also already looked through the article that you referenced and I wasn't able to find the solution to my problem.

    I finally got the Add-In working in Word 2007 by running all of the Windows Updates associated with Office 2007 and by removing the HKLM registry keys.  Any idea why the Add-In would only work as a current user installation and not as a machine wide (all users) installation?  Is there something specific that needs to be configured for an HKLM installation to work correctly?

    Tuesday, November 4, 2014 7:50 PM
  • So, I finally figured it out.  My Add-In now installs for all users and can run in Office 2007-2013.  It turns out that I needed to add the registry key mentioned in "https://support.microsoft.com/kb/976811" in both the 32-bit and 64-bit sections of the registry in my installer.  I didn't need to apply the hotfix because it was included in one of the Windows Updates for Office 2007.  I tried entering that registry key before, but I entered it manually on the machine that I was testing and forgot to enter it in the 64-bit section.

    So, all I needed to do was enter the EnableLocalMachineVSTO registry entry in both the SOFTWARE (32-bit) and SOFTWARE (64-bit) sections of the registry, along with the normal Addins registy entries, in my InstallShield installer.  It was just weird that the Add-In would install and be listed as an Add-In in Word, but would never load until I added those registry items.

    Thank you for your help Fei.  I appreciate your responses.



    • Marked as answer by snake14usa Wednesday, November 5, 2014 6:53 PM
    • Edited by snake14usa Wednesday, November 5, 2014 6:57 PM
    Wednesday, November 5, 2014 6:53 PM
  • Hi Snake,

    I am glad to hrear the issue was fixed, and thank you for sharing the solution with us . It is very helpful to other communities who have the same issue.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, November 6, 2014 1:21 AM
    Moderator