Reputation: 17080
I have a plugin which populates an array on an Excel spreadsheet. If the submitted parameters are wrong, it writes an error message in one cell instead.
Unfortunately, when the plugin displays the error message, Excel effectively disables the plugin. As a result, the next time I reopen the spreadsheet, I cannot refresh a previously correctly populated array - all the cells are filled with #NAME?. Also I cannot define a new array to populated via any function from my plugin - the whole category of functions defined in the plugin is not available.
However, when I go to File -> Options -> Add-Ins, the plugin is still listed as active.
I still can unregister the plugin via Add-Ins -> Manage Excel Add-Ins, and then register it again. This restores functionality.
Is there a way to make sure Excel does not automatically disable my plugin?
Upvotes: 0
Views: 84
Reputation: 35613
Excel will disable the plugin if it throws an exception, either a C++ exception, C# exception or an SEH exception.
Don't throw exceptions. Use the documented method to return error values.
You don't say what type of plugin - the method is different for each.
Upvotes: 1