Vba prevent user to see macro code in Excel
For example, I have a very complex macro based WorkBook that I share with people outside my organization. I would like to prevent outsiders from accessing my macro code.
This is also very useful to protect your VBA code that against copy and to protect your copyrights.
VBA code password protection is a good thing to do when you spent a lot of hours developing some code and that you do not want to be copied or modified
To do it in Excel, here is the answer:
a) In the VBA Editor, right click on "VBAProject (FILE)". Click on "VBAProject Properties".
b) "VBAProject - Project Properties" window pops up. Click on "Protection" tab.
c) Check "Lock project for viewing". Enter a Password. Confirm Password. Click OK.
d) When the file is opened the next time, a "VBAProject Password" dialog pops up. To gain access to the code, right password has to be entered.