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

Excel Quit event missing ?

Sep 8, 2011 at 2:14 PM

Why is there no Quit event in the Excel assembly ?

I have to handle this to properly dispose of the Excel object in case the user closes the Excel application.

Coordinator
Sep 8, 2011 at 2:18 PM
Edited Sep 8, 2011 at 2:18 PM

In order to prevent naming conflict, every event name in NetOffice has "Event" appended.
for you this means "NetOffice.ExcelApi.Application.QuitEvent"

please take a look in technical information
http://netoffice.codeplex.com/wikipage?title=Tec_Documentation_English_Events

Sep 8, 2011 at 2:29 PM

There's a Word.QuitEvent but not a Excel.QuitEvent. I first thought it was an intellisense problem (Word.Dispose isn't recognized and more) but it really isn't. (ExcelApi v1.2)

Error 1 'NetOffice.ExcelApi.Application' does not contain a definition for 'QuitEvent' and no extension method 'QuitEvent' accepting a first argument of type 'NetOffice.ExcelApi.Application' could be found (are you missing a using directive or an assembly reference?)

Coordinator
Sep 8, 2011 at 2:40 PM

oh yes now i see the excel application has no quit event. this is not a mistake from netoffice.
microsoft doesnt implement this event in excel. (i dont no why)

i take a look with google about this problem and find some interesstent things

http://stackoverflow.com/questions/3724301/prevent-excel-from-quitting

http://blogs.msdn.com/b/vsod/archive/2009/10/02/blog-idea-how-do-you-implement-application-quit-event-in-excel-how-do-you-intercept-excel-application-quit.aspx

http://www.pcreview.co.uk/forums/trapping-excel-close-event-t961034.html

Sep 8, 2011 at 5:10 PM

Thanks, I assumed you had simply forgotten the event - apologies :-)