Hello, Excellers. Welcome back to another #MacroMonday Excel tips blog post in my #Excel series. Are you an Excel user who creates macros and VBA code? If so, it’s essential to protect your code from unauthorized users and your Excel formulas. We’ll show you how to protect your VBA code with a password in this article.
Open Your VBA Project.
So, let’s work through an example to protect your VBA with a password. First, open your VBA project. Then, follow the steps below if you are unfamiliar with this process.
- Open Visual Basic – by hitting ALT +F11 or Developer Tab – Visual Basic
- Select your project from the list of projects if there is more than one
- Right-click on your project you want to protect
- Select VBA Project Properties
- Protection Tab
Password Protect Your VBA Project.
Now you have openined your Excel VBA project, it is time to password protect it. Just forllw the steps below.
- Check the Lock Project For Viewing
- Set a password
- Your VBA code is now password protected
That is all it takes to protect your code from prying eyes. Note that if you don’t check the box Lock project for viewing, the password only protects the configuration in VBAProject Properties. It will not protect the VBA code. Until you save and close the VB project and reopen it the password does not come into effect.
We hope this article was helpful in showing you how to protect your Excel VBA code. If you have any questions or concerns, please don’t hesitate to reach out to us for support. And be sure to sign up for our email list so that you can stay up-to-date on the latest news and information from us here at How To Excel At Excel. Thanks for reading!
If you want more Excel and VBA tips then sign up to my monthly Newsletter where I share 3 Excel Tips on the first Wednesday of the month and receive my free Ebook, 30 Excel Tips.
If you want to see all of the blog posts in the Macro Mondays Series or the example worksheets you can do so by clicking on the links below.
How To Excel At Excel – Macro Mondays Blog Posts.