I am trying to prevent closure of a workbook without a couple of questions being answered first. When the close button is clicked the action cancels until the questions are asked - I'm using a global variable to indicate whether the close cancels or not. The sub 'closer' has the questions, once they are answered the variable 'clsr' is set to true and thisworkbook.close is used The problem I have is this only closes the workbook however the Excel window remains open. I've tried numerous options but can't get to the point where the whole window closes - can anyone help?
Code I am using to check if variable = True prior to closing:
Thanks for any help
Code I am using to check if variable = True prior to closing:
VBA Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If clsr = False Then
Cancel = True
Call closer
End If
End Sub
Thanks for any help