Solved

Lock VBA viewing but using VBA

Posted on 2013-12-20
3
275 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
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…

821 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