Nov 23 2022 01:34 AM
Hi all,
I know this is an old thread, but I am facing problem enabling macros to all the users in my organization. so i want to hide the sheet initially and after enabling the macros i want the sheet to be visible and save, save as options should be disabled. while closing, I want the sheet to be again hidden so that next time opens it will ask the user to enable it ...
Nov 23 2022 03:56 AM
SolutionSee 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.
Nov 23 2022 08:42 PM
Nov 23 2022 03:56 AM
SolutionSee 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.