Solved

Lock VBA viewing but using VBA

Posted on 2013-12-20
3
271 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now