cocopops2001
Board Regular
- Joined
- Apr 18, 2011
- Messages
- 112
hello,
i want my workbook to have a custom 'YES NO' box on exit instead of the Excel Save Changes? box. I have my exit box working fine but when i click NO excel closes down, when i click yes the box reappears and i have to click YES twice. the box is called by workbook_beforeclose
any ideas?
EDIT: also when i click no the save changes box still appears? i have turned off application.displayalerts before the exitbox sub runs in the sub 'workbook_beforeclose'
i want my workbook to have a custom 'YES NO' box on exit instead of the Excel Save Changes? box. I have my exit box working fine but when i click NO excel closes down, when i click yes the box reappears and i have to click YES twice. the box is called by workbook_beforeclose
Code:
Dim ans As Integer
Sub exitbox()
ans = MsgBox("Do you want to Exit the calculation selector?", vbYesNo, "Exit")
Select Case ans
Case vbNo
No = True
Exit Sub
Case Else
End Select
If ans = vbYes Then
''''saves visible properties of each sheet
SaveStateAndHide
ThisWorkbook.Close Saved = True
End If
End Sub
EDIT: also when i click no the save changes box still appears? i have turned off application.displayalerts before the exitbox sub runs in the sub 'workbook_beforeclose'
Last edited: