View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Which x was clicked?

If you mean for a userform, then look at the queryclose event.

If you just mean using Excel events, I am not aware of a direct way to
differentiate. Depends on where the code is located and what you want to
do, but perhaps a sister workbook is open as hidden or an addin that contains
the application level closing code/actions. So when it closes, it knows the
application is being closed.

--
Regards,
Tom Ogilvy


"LoDawg" wrote:

I was wondering if anyone knew a way to tell if the big red X (Excel
app) was clicked as opposed to the little x(workbook). I need to handle
each occurance differently. Thanks