[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


How to protect macros from viewing and editiing

Posted on 2004-10-24
Medium Priority
Last Modified: 2011-09-20
I have lot of macros for my daily work in word.
I have made a SUB and within this I have put all other macros with Call procedure which are kept under Private Sub.
Now since the macro has to be run on various computers. I want:
1. Main sub should be visible and the Call procedures can be made able or disable.
2. All the Private sub under refrence of Call from main sub should be pasword protected and NOT VISIABLE OR EDITABLE OR IT SHOULD NOT EVEN HAVE A SAVE/EXPORT OPTION.
Is there any way to have this?
Thanks in advance for cooperation.
Question by:micazone
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
LVL 44

Accepted Solution

Arthur_Wood earned 750 total points
ID: 12393119
open word, then go to the Visual Basic Editor. In the projecdt explorer, right click on the Projecdt entry, select Properties,  then select the Protection tab.  There you can add a Password to the project, so that if anyone attempts to open then project in the Visual Basic Editor, they must first provide the password.


Author Comment

ID: 12394020
This will protect the entire project.
I want Main sub to be visible and editable to all. Only the oprivate subs to be protected. Is there any way.
LVL 26

Expert Comment

ID: 12394248
I don't think you can do it. Except you have write your own dll and call from you function
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 44

Expert Comment

ID: 12394345
try right clicking on each of the modules that hold the macros that you want to protect., and set the password at the module level - you will need to group your macros into separate modules, as the Password is MODULE level, not Macroi level.  

LVL 16

Expert Comment

ID: 12396481
By locking these with a password, you may find that the end user cannot run them without the password.

Just a thought...

LVL 44

Assisted Solution

Arthur_Wood earned 750 total points
ID: 12396924
actually, that is not the case.  The password only block editting the Macro, not executing it.

I have protected many apps this way, and users know nothing about the password protection.  What use would the password be if the user needed to know the password to execute the macro?  That same user could then also edit the macro...and the point of the password would be lost.


Author Comment

ID: 12407366
No it does not work.
Can you suggest a way to make a user form with check boxes for each macro. The macro module can be protected as suggested by you and let the user form be added to the tool bar and run from there.

Author Comment

ID: 12419799
I have solved the problem.
1. I created user form with severeal check boxes for each macro.
2. one sub for show the form.
3. Protected the code with pass word.
This siolved my problem

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

649 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