Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Canceling a quit event

Status
Not open for further replies.

ETID

Programmer
Jul 6, 2001
1,867
US
Is there a way to cancel this event?

If a user clicks the X or Chooses File>Close, I would like to check for certain conditions, and if all are true, then close the app. if not then cancel the close event.
 
Use the Workbook_BeforeClose( Cancel As Boolean ) event. Perform your tests and set Cancel=True if you want to disallow the close.
 
Thanks, that would be lovely, but I forgot to mention that I need to do this in Outlook, but I don't see a before close event or sub.



....any other thoughts?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top