• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

How to protect macros from viewing and editiing

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.
Shyam
0
micazone
Asked:
micazone
2 Solutions
 
Arthur_WoodCommented:
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.

AW
0
 
micazoneAuthor Commented:
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.
0
 
EDDYKTCommented:
I don't think you can do it. Except you have write your own dll and call from you function
0
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.

 
Arthur_WoodCommented:
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.  

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

Just a thought...

J.
0
 
Arthur_WoodCommented:
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.

AW
0
 
micazoneAuthor Commented:
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.
0
 
micazoneAuthor Commented:
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
Thanks
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now