Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook Before Close Event Cancel flag not functional(?)
I am attempting to use the before close event in VBA to perform some data
integrity checks, however the Cancel variable which is supposed to abort the workbook close event does not seem to be functioning as intended. I created a simple test (blank workbook, no other VBA except what is shown below) to try this out and again it failed. Debugging, it appears that the variable is indeed being set to correctly however setting it to true or false does not cause the close event to cancel. Since I've used this code before, I'm wondering if this is a bug or I just woke up too early this morning. My version info is Excel 2003 (11.6355.6360) SP1, VBA Retail 6.4.9972. Private Sub Workbook_BeforeClose(Cancel As Boolean) MsgBox("No you can't.") Cancel = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Workbook-Close StopTimer event | Excel Discussion (Misc queries) | |||
Close workbook with "Cancel=TRUE" in the BeforeClose()" | Excel Programming | |||
Input Box Cancel Event | Excel Programming | |||
Workbook Close Event | Excel Programming | |||
Clear Clipboard on Workbook Close Event (Excel XP) | Excel Programming |