Consulting

Results 1 to 5 of 5

Thread: How to hide macros or VBA codes

  1. #1
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location

    How to hide macros or VBA codes

    Hello Experts,

    Most of us know Alt+F11 will display the macro / vba project windows, and so protecting a sheet with a password doesnt work quite well then.

    Pls how do I I hide my macros or vba codes?

    Thanks a lot,
    Nee

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Hi Nee,
    you can protect you vba project in the vbe with a password. After using Alt+F11 to get to the vbe just click on the file name in the project explorer window on the left side.

    Look there for vbaproject (book1) where book1 is the name of the file. you can right click on any of the objects, sheets, modules etc and look for the line that says vba project properties.

    There are two tabs on the dialog box. Click on the protection tab and check the box that says lock project for viewing and then add your password below.

    bear in mind that this is minimal protection but it will keep out most average users.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    ps don't forget your password or make a copy to distribute that is password protected...
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  4. #4
    Quote Originally Posted by Nee
    Hello Experts,

    Most of us know Alt+F11 will display the macro / vba project windows, and so protecting a sheet with a password doesnt work quite well then.

    Pls how do I I hide my macros or vba codes?

    Thanks a lot,
    Nee
    Hi Nee,
    And to hide from the Tools>Macro> list put this at the top of your module:
    Option Private Module
    Dave
    "The game is afoot Watson"

  5. #5
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location
    Hello Lucas and Dave,
    Very fast turnaround -- Thanks a bunch for the quick tip; it works.

    Best regards,
    Nee

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •