Able to catch Application.Quit similar?

R

Rich Wallace

Hi all,

I have a workbook that contains code to run on Workbook_BeforeClose and also
some code on Sheet1 that executes Worksheet_Change.

If the user opens my workbook from an existing running instance of Excel, I
catch the changes I need from my Worksheet_Change but if the user closes the
Excel app, and not the workbook itself, my Workbook_BeforeClose event is
never fired. Is there a way from within my ThisWorkbook module I can trap
for an Applciation.Quit event and still run the code I process for the
Workbook_BeforeClose event?

TIA
-Rich
 
N

Nigel

Not sure I have the answer but I think you need to create a new application
class event which is fired when an event like quit occurs, I have not
investigateed much further but you might like to explore this approach.

Cheers
Nigel
 
R

Rich Wallace

That makes sense, I'll give it a shot, thank you.

Nigel said:
Not sure I have the answer but I think you need to create a new application
class event which is fired when an event like quit occurs, I have not
investigateed much further but you might like to explore this approach.

Cheers
Nigel

Excel,




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
T

Tom Ogilvy

I couldn't reproduce your problem. The beforeclose event in the workbook
fired, even when I had code in another workbook run a macro that had the
command application.Quit

Sounds like you are looking for the wrong solution. You should find what
conditions are causing it not to fire.
 
R

Rich Wallace

I think I found it, the code in the main application sets the EnableEvents =
False

Damn

Thank you for the responses though, I truly appreciate the help.
-Rich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top