Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Lock VBA viewing but using VBA

Posted on 2013-12-20
3
Medium Priority
?
279 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
[X]
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
3 Comments
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 1000 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 1000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

721 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