Forum Discussion
I want to disable save and save as options using VBA plus hide the sheet during close
- Nov 23, 2022
See the attached example workbook.
The VBA code has been protected with password 123. You should change this to a safer one: in the Visual Basic Editor, select Tools > VBAProject Properties... > Protection tab.
If you want to make changes to the workbook and save it, activate the Immediate window in the Visual Basic Editor (Ctrl+G), type the following line and press Enter:
Application.EnableEvents = False
Don't forget to hide the sheet named Hidden before saving the workbook.
Don't forget to enable events again afterwards:
Application.EnableEvents = True
Warning: this is not watertight. Knowledgeable users will be able to bypass the protections.
See the attached example workbook.
The VBA code has been protected with password 123. You should change this to a safer one: in the Visual Basic Editor, select Tools > VBAProject Properties... > Protection tab.
If you want to make changes to the workbook and save it, activate the Immediate window in the Visual Basic Editor (Ctrl+G), type the following line and press Enter:
Application.EnableEvents = False
Don't forget to hide the sheet named Hidden before saving the workbook.
Don't forget to enable events again afterwards:
Application.EnableEvents = True
Warning: this is not watertight. Knowledgeable users will be able to bypass the protections.
- imsureshbio1109Nov 24, 2022Copper ContributorThanks. It works like a charm satisfy my needs.