I want to close my workbook only by using the Exit button I made. I disabled the close X on the workbook using
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Sheet1.Exit1.Activate Then
Cancel = False
Else
MsgBox ("Use Exit Option")
Cancel = True
End If
End Sub
But now when in am asking to close in exitbutton_click() it showing the same MsgBox "Use Exit Option"
Please help me
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Sheet1.Exit1.Activate Then
Cancel = False
Else
MsgBox ("Use Exit Option")
Cancel = True
End If
End Sub
But now when in am asking to close in exitbutton_click() it showing the same MsgBox "Use Exit Option"
Please help me