Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can I somehow get a notification when the user tries to close the excel
application? Say, I just want to pop open a message box asking user if she indeed wants to exit. Thanks, --Avs |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Avneesh.
I really would not recommend to do it cause it is annoying. Because I know I want to close when I click the X button I dont like to be asked if I wanna do it either way if you still think is a good Idea or have a special project then use this. Private Sub Workbook_BeforeClose(Cancel As Boolean) myans = MsgBox("Are you sure you wanna get out of here?", vbYesNo) If myans = vbNo Then Exit Sub Else Application.Quit End If End Sub Regards, Cesar Zapata "Avneesh Saxena" wrote in message ... Can I somehow get a notification when the user tries to close the excel application? Say, I just want to pop open a message box asking user if she indeed wants to exit. Thanks, --Avs |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks! However, I don't want to trap workbook close events but I want to
trap the closing of the main window (which is obviously different). lso, I'm not going to popup a dialog but I do want to make some programatic changes, that was just the simplest way to put it :-). Thanks, --Avs "Cesar Zapata" wrote in message ... Avneesh. I really would not recommend to do it cause it is annoying. Because I know I want to close when I click the X button I dont like to be asked if I wanna do it either way if you still think is a good Idea or have a special project then use this. Private Sub Workbook_BeforeClose(Cancel As Boolean) myans = MsgBox("Are you sure you wanna get out of here?", vbYesNo) If myans = vbNo Then Exit Sub Else Application.Quit End If End Sub Regards, Cesar Zapata "Avneesh Saxena" wrote in message ... Can I somehow get a notification when the user tries to close the excel application? Say, I just want to pop open a message box asking user if she indeed wants to exit. Thanks, --Avs |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Close Excel mac help window | Excel Discussion (Misc queries) | |||
Cannot maximize an existing workbook in the excel main window. | Excel Discussion (Misc queries) | |||
How can you close a window with the back button in excel | Excel Discussion (Misc queries) | |||
After Close Event? | Excel Programming | |||
Close explorer window from excel VBA | Excel Programming |