Solved

Lock VBA viewing but using VBA

Posted on 2013-12-20
3
274 Views
Last Modified: 2013-12-20
Is there a way to lock the Excel VBA from viewing but using VBA?

Standard way:
Tools->VBAProject Properties->Protection (Tab)

I want to do the same thing but use VBA to accomplish.
0
Comment
Question by:patriotpacer
3 Comments
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 250 total points
ID: 39732248
Not really. You can use code to determine whether the code is locked or not, but the setting is read-only. This is from the help file:

Property (VBA Add-In Object Model)

Returns a value indicating the state of protection of a project. Read-only.

Return Values

The Protection property return values are:

Constant Description
vbext_pp_locked The specified project is locked.
vbext_pp_none The specified project isn't protected.
0
 
LVL 11

Accepted Solution

by:
Guru Ji earned 250 total points
ID: 39732252
There are only three ways you can hide your VBA code

1. using Secure VBA Code with a Password
2. Hide VBA Code in a Read-Only File with Access 2007
3. Protect Your VBA Code by Making an Add-In

There is no way to accomplish it via another VBA code within your existing VBA code.

Here are the details of the steps above if you want to pursue one of them
0
 

Author Closing Comment

by:patriotpacer
ID: 39732259
Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
conditional formatting 4 43
Excel IF formula 3 21
Why do I often "Too many different cell formats" error message in Excel2010? 2 26
Clear Filter 8 40
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

777 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