Excel 2013 VBA - How to Prevent Users From Accessing the VBE

brothertruffle880 used Ask the Experts™
I want to prevent users from accessing the VBE and modifying macro code. How can I do this?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
From the Developer tab select Visual Basic - Tools - Visual Basic Properties. Select the Protection tab and check the box labeled Lock project for viewing. Enter a password and select OK. You will now need the password to get to the macros.

Mechanical Engineer
Most Valuable Expert 2013
Top Expert 2013
First possibility: password protect your VBA Project. You do this in the VBA Editor using the Tools...VBAProject Properties...Protection menu item. Check the box for "Lock project for viewing," add a password and click OK.
Password protect VBA codeYou should be aware that the VBA password can be broken using a manual technique, as well as by commercial software. It will keep honest users from tampering with your code, but not a determined hacker.

Second possibility: buy a copy of Unviewable+ from its developer Petros Chatzipantazis at Spreadsheet1. The protection it provides is more robust than a VBA password. The software costs about $100 last time I checked, and was worth the price asked in my opinion.

There are even more expensive ways to protect your intellectual property, such as LockXLS. I never purchased this package, but one of my clients did. It
Roy CoxGroup Finance Manager

Even Unviewable can be bypassed. I won't post how though.


Many thanks for the guidance!
Glad to help out!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial