Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to re-add a deleted VSTO Add-In

I've got a strange issue with a Word VSTO add-in on one machine where running the visual studio project opens word but does not attempt to start the add in as far as I can tell.

I got to this point because I accidentally clicked Remove for the Add-in on the Manage COM Add-ins page, instead of re-enabling it after a failure.

I want to know how to re-enable a deleted add-in - I'm thinking that perhaps there is a registry key somewhere I need to get rid of.

  • When I run the project from Visual Studio it does not attempt to start up at all, Word starts instantly with no "something-is-failing" type pause.
  • No breakpoints in ThisAddIn_Startup are hit.
  • In Word : File/Options/Add-ins - the add-in does not appear under Inactive or Disabled Addins
  • Word : Manage COM Add-ins Go... it does not appear.
  • Word : Manage Disabled Items Go... is empty.

I've tried installing and uninstalling the published version, to see if that wakes anything up, and I've tried changing the path of the VS project, just in case that makes a difference (and various restarts, cleans, rebuilds, locally deleting and re-cloning from git etc) but I can't find a way to get this to work again. On a different machine, cloning the add-in from Git and opening it in Visual Studio and its all fine.

I've tried re-adding via the select DLL (or select .) dialog on the COM Add-ins but nothing I select appears to be a valid add-in.

Any help to figure out how to get back to a working development environment would be appreciated.

EDIT There's a lot going on below - so I thought I'd clarify that the successful solution was the online-repair of Office

like image 624
Andiih Avatar asked May 20 '19 15:05

Andiih


People also ask

How do you create a VSTO Excel add-in?

To create a new Excel VSTO Add-in project in Visual StudioOn the File menu, point to New, and then click Project. In the templates pane, expand Visual C# or Visual Basic, and then expand Office/SharePoint. Under the expanded Office/SharePoint node, select the Office Add-ins node.

Where are VSTO add-ins installed?

The required VSTO Add-in registry entries are located under the following registry keys where Root is HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE depending if the installation is for the current user or all users.

How do I update VSTO add-ins?

If you want to get your add-in auto-updated you need to publish it to any web server and then install it from there. Then if required you may publish an update. Your add-in will be automatically updated.

How do I re-enable a VSTO add-in?

To re-enable a VSTO Add-in In the application, click the File tab. Click the ApplicationName Options button. In the categories pane, click Add-ins. In the details pane, verify that the VSTO Add-in appears in the Disabled Application Add-ins list.

What is soft disable VSTO add in?

Soft disabling can occur when a VSTO Add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable a VSTO Add-in if it throws an unhandled exception while the Startup event handler is executing.

How do I add a VSTO add-in to an existing assembly?

In the details pane, verify that the VSTO Add-in appears in the Inactive Application Add-ins list. The Name column specifies the name of the assembly, and the Location column specifies the full path of the application manifest. In the Manage box, click COM Add-ins, and then click Go.

How do I find the path of a VSTO add-in?

In the details pane, verify that the VSTO Add-in appears in the Inactive Application Add-ins list. The Name column specifies the name of the assembly, and the Location column specifies the full path of the application manifest.


2 Answers

I believe that you need to change the version of the VSTO add-in in order to be able to update it or re-install it. Once an add-in version has been disabled, this is permanent.

See Uninstall MS Word Add-in for details. Let me know if that worked.

like image 55
RobertBaron Avatar answered Feb 13 '23 06:02

RobertBaron


What is the LoadBehaviour in the registry? It should be 3...

To find out, look in

  • 32bit Word => Root\Software\Microsoft\Office\Word\Addins\add-in ID
  • 64bit Word => Root\Software\Wow6432Node\Microsoft\Office\Word\Addins\add-in ID

where Root is HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE, depending on whether the addin is installed for current user or everyone.

If the value for LoadBehaviour is not 3, then change it to 3 and restart Word.

Here is the Microsoft docs about it: Registry entries for VSTO Add-ins

If it still does not work, try to re-enable as it might be hard disabled:

  • In the Manage box, change COM Add-ins to Disabled Add-ins, and click Go.
  • Select the add-in and click Enable. Click Close. Now the add-in can be loaded again...
  • Back in the Manage box, change Disabled Add-ins to COM Add-ins, and then click Go.
  • Check the checkbox next to the disabled add-in. Click OK.

Here is the Microsoft docs about it: How to: Re-enable a VSTO Add-in that has been disabled

Also, if you haven't done this already, it is worth setting VSTO_SUPPRESSDISPLAYALERTS to 0 as described on this page: How do I enable VSTO error / display alerts?

If none of the above helps, then it is worth doing a Online repair of Office from Add or Remove Programs.

like image 38
Leo Avatar answered Feb 13 '23 07:02

Leo