I have created an excel ad din using visual studio 2010. I'm using click Once deployment to deploy to a share drive and let all the users in my office that have access to this shared drive install in there machines. The problem that I'm currently encountering is that once the user installs the ad-din- it works fine. The ribbon has a the additional ad-din tab I have designed to show up. However, if they shut down Excel and they come back in moments later the ad din is disabled. The user now has to re-enable the ad-din by simply going back into excel options -> Add-Ins -> manage drop-down choose Com ad-dins --> click go then check the ad-din again. I would like the com ad din always load when the user starts Excel. I have checked the load behavior and is set to 3 I'm baffled on why this continues to happen any suggestions or ideas on how to debug this behavior i would be unbelievably grateful. I have also read through this post and have come up empty on my solution.
2 Answers
Most probably your add-in fires exceptions at runtime. In that case Office appliactions disable add-ins. Did you have a chance to check out the Disabled Items list?
Microsoft Office applications can disable add-ins that behave unexpectedly. If an application does not load your add-in, the application might have hard disabled or soft disabled your add-in.
Hard disabling can occur when an add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your add-in is executing.
Soft disabling can occur when an add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable an add-in if it throws an unhandled exception while the Startup event handler is executing.
When you re-enable a soft-disabled add-in, the application immediately attempts to load the add-in. If the problem that initially caused the application to soft disable the add-in has not been fixed, the application will soft disable the add-in again. Read more about that in the How to: Re-enable an Add-in That Has Been Disabled article in MSDN.
Also I'd suggest checking the Trust Center settings. Is Macro Security applied to COM add-ins? Should add-ins be signed with a digital signature?

- 47,483
- 3
- 24
- 45
-
Eugene thanks for the reply. That's the interesting thing. I have put a try catch on my (ThisAddIn_Startup) and I'm not getting any errors? I'm just not sure what could possibly be causing this issue. Also the macro security's are turned on the trust center. – Miguel May 09 '15 at 12:42
-
An exception can be fired while your add-in is loaded, but the startup method is not called yet. Or some of the dependencies cannot be found. Also take a look at the [How to troubleshoot a VSTO addin that does not load?](http://stackoverflow.com/questions/4668777/how-to-troubleshoot-a-vsto-addin-that-does-not-load) similar thread. – Eugene Astafiev May 09 '15 at 17:02
-
Thank you,your answer helped me get to the bottom of it. The ThisAddIn_Startup method had code in it that was not throwing an error but as soon as I removed it everything started to work appropriately. – Miguel May 11 '15 at 12:54
-
@Miguel, i'm very happy you find out the problem, but don't you think some one mentioned this before this post ;) – Technovation May 12 '15 at 06:50
If Excel application does not load your add-in, the application might have soft disabled your add-in (in your case). maybe your application throws an unhandled exception while the Startup event handler is executing. check your Startup event handler(ThisAddIn_Startup). i think this link would be helpful.

- 397
- 2
- 12