wpf - How to suppress Disable add-in dialog when Excel is force close -


my addin written in c#, netoffice, exceldna using wpfframework. part uses winforms, too. main ui wpf

when there modal dialog displayed, users force close excel. next time when launch excel, excel " excel experienced serious problem '*' add-in. if have seen message multiple times, should disable add0in , checke see if update available. want disable add-in?"

yes, no

users click yes or enter without reading message , add-in disappears excel. not want dialog show up. possible , how?

i try catch exception in autoopen() below. seems have no effect stop dialog @ all.

    public void autoopen()     {            .....             system.windows.forms.application.threadexception += applicationonthreadexception;             appdomain.currentdomain.unhandledexception += currentdomainunhandledexception;              dispatcher.currentdispatcher.unhandledexception += currentdispatcher_unhandledexception;             taskscheduler.unobservedtaskexception += taskscheduler_unobservedtaskexception;  ....      }       public void taskscheduler_unobservedtaskexception(object sender, unobservedtaskexceptioneventargs e)     {         helper.logerror(e.exception);                 }      public void applicationonthreadexception(object sender, threadexceptioneventargs threadexceptioneventargs)     {         helper.logerror(threadexceptioneventargs.exception);     }      public void currentdomainunhandledexception(object sender, unhandledexceptioneventargs args)     {         if (!(args.exceptionobject threadabortexception))         {             exception exc = args.exceptionobject exception;                            helper.logerror(exc);         }                }      public void currentdispatcher_unhandledexception(object sender, dispatcherunhandledexceptioneventargs e)     {         helper.logerror(e.exception);         e.handled = true;     } 

i presume 'users force close excel' mean user ends excel process task manager or something.

excel puts internal guards in place around ribbon handler calls, if excel crashes during ribbon event handler, excel knows add-in called when crash happened, disable next time describe. if excel terminated unexpectedly while modal dialog shown, add-in 1 remembered 'cause'.

your attempt @ handling unhandled exceptions not work, since .net hosted in native process (in excel). unhandled exceptions bubble excel won't returned .net runtime, more crash whole excel process. trying handle more exceptions not help.

perhaps modal dialog not right approach, since causes users confused , think excel has crashed, causing unexpected termination. @ least sure set excel window parent of modal dialog, dialog stays in front of excel.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -