Atiqul Haque
New Member
- Joined
- Dec 13, 2020
- Messages
- 45
- Office Version
- 2016
- Platform
- Windows
Dear All Good Evening,
With the following codes to disable workbooks close(X) button, first time it works but when i click it again the workbook get closed.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = True
End Sub
I need the following:
#1. Disable or prevent to close entire workbook by normal excel close(X) button. &
#2. Workbook should closed by a vba command button.
Best Rgds,
With the following codes to disable workbooks close(X) button, first time it works but when i click it again the workbook get closed.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = True
End Sub
I need the following:
#1. Disable or prevent to close entire workbook by normal excel close(X) button. &
#2. Workbook should closed by a vba command button.
Best Rgds,