how to quit in BeforeClose
Hi.
(Excel 2010) I need to check if the user has changed the name at the actual sheet before the workbook is closed. In my sub Workbook_BeforeClose(Cancel As Boolean) I have a YesNo box. The intention is, that if the user select No the workbook shall remain open, e.g. the sub shall not be executed. How do I do ? Regards Peter |
how to quit in BeforeClose
On Jul 14, 7:49*am, Peter wrote:
Hi. (Excel 2010) I need to check if the user has changed the name at the actual sheet before the workbook is closed. In my sub Workbook_BeforeClose(Cancel As Boolean) I have a YesNo box. The intention is, that if the user select No the workbook shall remain open, e.g. the sub shall not be executed. How do I do ? Regards Peter As ALWAYS, post your efforts for comments and suggestions. |
how to quit in BeforeClose
Hi.
I did find a way: Sub Workbook_BeforeClose(Cancel As Boolean) a = MsgBox("Fik du rettet navnet på det nye ark ?", vbYesNo) If a = vbNo Then Cancel = True end sub Thank you Peter |
how to quit in BeforeClose
Peter expressed precisely :
Hi. I did find a way: Sub Workbook_BeforeClose(Cancel As Boolean) a = MsgBox("Fik du rettet navnet på det nye ark ?", vbYesNo) If a = vbNo Then Cancel = True end sub Thank you Peter Congratulations!!! That's exactly how it's done... -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
All times are GMT +1. The time now is 05:11 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com