8

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?

Lance Roberts
  • 22,383
  • 32
  • 112
  • 130
David Korn
  • 1,091
  • 4
  • 12
  • 19

2 Answers2

6

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.

Community
  • 1
  • 1
RedBlueThing
  • 42,006
  • 17
  • 96
  • 122
  • 2
    yup auto disable is quite possible. Most addins wont have a trusted publisher so they just get disabled after Excel AVs. It doesn't even have to be the addin's "fault", if something else caused the crash but the addin's function was on the stack at that point in time then Excel will lay blame at the addin's feet and disable it. – Anonymous Type Sep 08 '11 at 01:11
  • 1
    Little late to the party - but to add on to the next steps - if your add-in is crashing and you are unable to reproduce it - you can ask the user to take a crash dump using procdump or adplus and send you the dump file. You can then debug this with windbg/ntsd etc. – quixver Sep 20 '12 at 18:22
4

I've seen this happen when an add-in has a fatal error and the process dies. Excel will notice that and either auto disable for the next time or offer to disable. Does your add-in log this kind of an error?

Chris Hynes
  • 9,999
  • 2
  • 44
  • 54
  • I have the same issue and have no solution yet. I try to log all error/exceptions but it seems not working. see http://stackoverflow.com/questions/16447595/how-to-suppress-disable-add-in-dialog-when-excel-is-force-close – toosensitive May 08 '13 at 22:31