How to troubleshoot why Excel disables an add-in?

David Korn picture David Korn · Feb 10, 2009 · Viewed 29.5k times · Source

I've written an Microsoft Excel add-in in .NET using Add-in Express, and deployed it to about 50 different user sites, all running Office 2003 on Windows XP. The add-in works fine at the majority of sites, but in a few cases, Excel seems to disable the add-in after a while, and they have to find it on the disabled items list to re-enable. Re-enabling seems to take care of it, at least temporarily, though it's too soon to say if it will happen again. So I'm trying to figure out why Excel is disabling the add-in, but all I'm looking for here is just a general method to find out why Excel disables an add-in. In my situation, the add-in is running at remote sites, and I've had limited access to troubleshoot. I did look in the event log and didn't spot anything. I also have error logging in my add-in, and that hasn't caught anything.

Any suggestions?

Answer

RedBlueThing picture RedBlueThing · Mar 5, 2009

I am pretty sure that Excel won't disable your addin automatically (I haven't found anything describing this behaviour, please correct me if I have missed it). However, if the addin crashes/hangs etc, then the next time Excel starts, a dialog pops up saying "This addin had a fatal error, would you like to disable it?" (as Chris points out).

I find that users will invariably just click yes, so they can get on with their work. It might be worth talking to your users and see if they have seen something like this.

Obviously there is an underlying problem with the addin that you would like to get to the bottom of. I guess your next steps might be (I apologise if these are obvious debugging steps that you have tried):

  • Definately add some config to crank up your logging to try and narrow down what is going on.
  • Talking to users and find out conditions that led to hang/crash in Excel, so you can try and reproduce the problem (if this is a crash then logging might not help much).
  • Blocking calls in your addin or in code that you are calling that might lead to a user killing a non-responsive Excel?

Good luck tracking down the issue.

Edit: I apologise, there are cases were Excel will automatically disables addins. I found the following in the Security Center help for addins:

Disable notification for unsigned add-ins (code will remain disabled) This check box is available only if you select the Require Application Extensions to be signed by Trusted Publisher check box. In some situations, the dynamic-link library (.dll) (Dynamic Link Library: A set of routines that can be called from Visual Basic procedures and are loaded and linked into your application at run time.) file that contains the add-in might be unsigned. In these cases, add-ins signed by a trusted publisher are enabled, but unsigned add-ins are disabled silently.

Disable all Application Add-ins (may impair functionality) Select this check box if you don't trust any add-ins. All add-ins are disabled without any notification, and the other add-in check boxes are made unavailable.