Run macro on exit by red cross

C

CarlosTapas

I need to run a macro when an end user closes excel by the red cross.

I'm currently using: Workbook_BeforeClose(Cancel As Boolean)
This works fine when they close just the workbook.

(I also have a "close and change settings" button they should press)

Why do I need this? I am changing the settings from manual to automatic.

Thanks in advance,
 
J

Jim Cone

The Workbook_BeforeClose event should run when Excel is closed.
Do you have Application.EnableEvents set to False?
--
Jim Cone
Portland, Oregon USA



"CarlosTapas"
<[email protected]>
wrote in message
I need to run a macro when an end user closes excel by the red cross.
I'm currently using: Workbook_BeforeClose(Cancel As Boolean)
This works fine when they close just the workbook.
(I also have a "close and change settings" button they should press)
Why do I need this? I am changing the settings from manual to automatic.
Thanks in advance,
 

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