Hide or Lock VB codes in Excel

Posted on 2014-07-25
Last Modified: 2014-08-20
Hi ,
I have an excel sheet file with full of VB codes, need to give it to client, but don't want them to see all my codes.
At the same time, want them to be able to run.

Please advise
Question by:fparvini
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 92

Expert Comment

by:Patrick Matthews
ID: 40220708
In the VBA Editor you can lock the VBA project with a password.  Keep in mind, though, that this password is inherently insecure, and can be cracked very, very easily using readily available, inexpensive hacking tools.
LVL 13

Expert Comment

ID: 40220866
Take a look this for 3 method to secure your VBA

If method-2 is not safe enough , method-3, using Add-in that saved in other workbook will be

LVL 16

Expert Comment

by:Jerry Paladino
ID: 40221662
Screen captures showing the steps to lock the VBA code for viewing and editing. Select the Protection tab in the VBAProperties Dialog check box, click the box to prevent viewing and enter a password required to open the project.  As Patrick noted above, this can be hacked very easily with tools if someone really wants your code.   If the requirement is to prevent your user community from accidentally changing the code, this works very well.  VBAProject SubmenuVBAProject Properties Dialog
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 12

Expert Comment

by:James Elliott
ID: 40222849
Share & protect the workbook is probaly the best of a bad bunce of options. That makes the VB project unviewable, and it's a bit harder to crack.


LVL 92

Expert Comment

by:Patrick Matthews
ID: 40224933
Do note, though, that sharing the workbook is itself inherently dangerous; having multiple people in the file at once creates a huge risk of file corruption.  It is only a slight exaggeration to say that there are only two types of shared workbooks: those that are corrupt, and those that soon will be :)
LVL 12

Accepted Solution

James Elliott earned 500 total points
ID: 40225218
Very true
LVL 12

Expert Comment

by:James Elliott
ID: 40275468
Not sure that was deserved.

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question