ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Pop up message at closing (https://www.excelbanter.com/excel-discussion-misc-queries/44689-pop-up-message-closing.html)

chanwando

Pop up message at closing
 

I need to somehow get excel to "popup" a confirmation window when the
user attempts to close out. The message would be something along the
lines of "Is this the correct product?". If yes, excel would exit, if
not, then no.

I would really appreciate anyone who has the time/patience to assist me
with this.

Thank you!

Chandra


--
chanwando
------------------------------------------------------------------------
chanwando's Profile: http://www.excelforum.com/member.php...o&userid=27123
View this thread: http://www.excelforum.com/showthread...hreadid=466362


Chip Pearson

Chandra,

Put the following code in the ThisWorkbook code module:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If MsgBox("Is this correct?", vbYesNo) = vbNo Then
Cancel = True
End If
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"chanwando"
wrote in
message
...

I need to somehow get excel to "popup" a confirmation window
when the
user attempts to close out. The message would be something
along the
lines of "Is this the correct product?". If yes, excel would
exit, if
not, then no.

I would really appreciate anyone who has the time/patience to
assist me
with this.

Thank you!

Chandra


--
chanwando
------------------------------------------------------------------------
chanwando's Profile:
http://www.excelforum.com/member.php...o&userid=27123
View this thread:
http://www.excelforum.com/showthread...hreadid=466362




chanwando


Thanks Chip! I really appreciate the help on this one!

Have a GREAT day!

Chandra


--
chanwando
------------------------------------------------------------------------
chanwando's Profile: http://www.excelforum.com/member.php...o&userid=27123
View this thread: http://www.excelforum.com/showthread...hreadid=466362



All times are GMT +1. The time now is 10:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com