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
Technology Partners: 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

752 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