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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NOT closing Excel from Excel

Status
Not open for further replies.

ajones

Programmer
Feb 12, 2001
20
US
I've seen some posts about preventing users from directly closing workbooks within Excel.

My question is: From a VB6 application, is there a way to prevent users from closing Excel itself? Something perhaps that would allow VB to detect a user's attempt and cancel it (not unlike the Form_QueryUnload's cancel parameter in VB...)?

I think I saw something about this somewhere but I can't for the life of me remember where.

Any help would be greatly appreciated.
 
Only way i can think of (and I'm not sure it would work), is by hooking the window's messages and not allowing the WM_CLOSE command to be sent (or whatever message is sent to close a window).. However, lately, I've had trouble subclassing windows :-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top