Lock VBA viewing but using VBA

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.
patriotpacerAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Guru JiConnect With a Mentor Commented:
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
 
GrahamSkanConnect With a Mentor RetiredCommented:
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
 
patriotpacerAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.