Reputation: 6845
Is there any way I can lock or freeze the VBE
editor to prevent others from accidentally editing the VBA code?
I don't want to lock down the whole workbook where people can run macros but can't see the code.
I want to let others see the code but don't want them accidentally deleting something and break the program (something even I am prone to doing to my code).
Upvotes: 1
Views: 3218
Reputation: 93
Just go to Visual Basic, right click your module, select VBA Project Properties..., under protection tab, you can lock your VBA code with password.
Hope this help. ^^
Upvotes: 2
Reputation: 9461
If you want the code to be visible and executable, then you can't stop people from making changes to it. You can however, stop them from saving those changes, by opening the workbook as read-only. You can mark a workbook as read-only in the File Properties from within File Explorer. Or, if your workbook is opened via Automation, then you can specify read-only in the open method.
Upvotes: 1