This project has moved. For the latest updates, please go here.

Excel Addin prozess does not close

Oct 18, 2013 at 7:55 AM
Hi

after closing Excel the process does not Close. What can i do?
 void Addin_OnConnection(object applicationObject, NetOffice.Tools.ext_ConnectMode connectMode, object addInInst, ref Array custom) {
         application = Factory.CreateObjectFromComProxy(null, applicationObject);

          if (application is Excel.Application)
                    hostApplicationName = "Excel";
           }
               ......
}
After connect I do some Excel functions
workSheet = (Excel.Worksheet)GetActiveExcelWorkbook().ActiveSheet;
workSheet ....
void Addin_OnDisconnection(NetOffice.Tools.ext_DisconnectMode removeMode, ref Array custom) {
           if (null != application)
                    application.Dispose();
                   // application.ReleaseCOMProxy();
            } 
}
What elese can I do? I won't hard kill the Prozess.

Best regards
Coordinator
Oct 21, 2013 at 8:28 AM
Edited Oct 21, 2013 at 9:03 AM
whats count of open proxies in your application after dispose?
yee see this here: NetOffice.Factory.ProxyCount

*sebastian
btw: disable other addins for testing. may you are not guilty.
Oct 21, 2013 at 10:01 AM
After a lot of testing I found my error.

I used System.Timers.Timer after I changed to System.Windows.Forms.Timer it's working. Don't know why but no it's ok ;-)
Coordinator
Oct 21, 2013 at 10:33 AM
if you want send me a sample solution to public.sebastian[at]web.de. System.Timers.Timer use another for Thread for the Tick trigger. This may cause side effects in your application. btw: a timer is generaly not a good idea in office addins. why you need this?

*sebastian