Customize the exit operation


Posted by Rohit on December 04, 2000 1:24 PM

Hi,

In an excel application, while closing the excel sheet
using the control menu options i.e "x" mark on the top
right hand corner: you get a message:
"Do you want to save the changes before closing the
book1".

Now I need to put my own customized message over here
or I need to run my own macro when the user clicks this
How do I achieve it?

Can help in this regard would be very much appreciated.

TIA,
Rohit



Posted by Skip Bisconer on December 04, 2000 9:09 PM

In VBA Click ThisWorkbook in the right hand window scroll down and highlight "BeforeClose"

VBA Code would be something like this;

msgBox "Do what you have to do while closing this workbook"

End Sub