Forum Discussion
Disable View Code in Protected Worksheets
- Sep 18, 2023
Activate the Visual Basic Editor.
Select Tools > VBAProject Properties...
Activate the Protection tab.
Tick the check box 'Lock project for viewing'.
Enter a password in the Password box, and enter it again in the 'Confirm password' box.
Don't forget this password - you'll need it later if you want to view/edit the VBA code!
Click OK.
Save the workbook.
Close and reopen the workbook. You'll find that you cannot view the code if you cannot provide the password.
Warning: this is not 100% tamper-proof. There are ways to disable the password.
Activate the Visual Basic Editor.
Select Tools > VBAProject Properties...
Activate the Protection tab.
Tick the check box 'Lock project for viewing'.
Enter a password in the Password box, and enter it again in the 'Confirm password' box.
Don't forget this password - you'll need it later if you want to view/edit the VBA code!
Click OK.
Save the workbook.
Close and reopen the workbook. You'll find that you cannot view the code if you cannot provide the password.
Warning: this is not 100% tamper-proof. There are ways to disable the password.
- HansVogelaarSep 18, 2023MVP
You're welcome!