Link to home
Create AccountLog in
Avatar of Milan Soni
Milan Soni

asked on

How to hide/lock macro and its codes?

I want to provide the user with the macro in an excel but I do not want them to see my macro codes, is it possible? if yes please suggest.

I want to implement this in Excel and word application both.
Avatar of Shums Faruk
Shums Faruk
Flag of India image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
In the Visual Basic Editor you can protect each module with a password. By doing so only users that know the password can open the module.

This is a limited form of protection as Excel passwords are not the most secure but it would stop any casual prying.
To protect the code, open the Excel Workbook and go to Tools>Macro>Visual Basic Editor (Alt+F11). Now, from within the VBE go to Tools>VBAProject Properties and then click the Protection page tab and then check "Lock project from viewing" and then enter your password and again to confirm it.
Avatar of Milan Soni
Milan Soni


This was helpful.