Solved

How to protect macros from viewing and editiing

Posted on 2004-10-24
157 Views
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.
Shyam
0
Question by:micazone
    8 Comments
     
    LVL 44

    Accepted Solution

    by:
    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
     

    Author Comment

    by:micazone
    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
     
    LVL 26

    Expert Comment

    by:EDDYKT
    I don't think you can do it. Except you have write your own dll and call from you function
    0
     
    LVL 44

    Expert Comment

    by:Arthur_Wood
    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
     
    LVL 16

    Expert Comment

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

    Just a thought...

    J.
    0
     
    LVL 44

    Assisted Solution

    by:Arthur_Wood
    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
     

    Author Comment

    by:micazone
    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
     

    Author Comment

    by:micazone
    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    913 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

    17 Experts available now in Live!

    Get 1:1 Help Now