Consulting

Results 1 to 6 of 6

Thread: Solved: Hiding Code

  1. #1
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    323
    Location

    Solved: Hiding Code

    Is there a way to hide vba code or block access to the code viewer?

    Thanks
    Gary

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Open the VBE and go to Tools | VBAProject Properties...
    Click the Protection tab.
    Check the box for Lock project for viewing.
    Add a password.

  3. #3
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    323
    Location
    Thanks for the quick response DRJ. I did as you suggested but it doesn't seem to work. I can still get into and modify the vba code and it doesn't ask me to supply the password that I set.

  4. #4
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    323
    Location
    Disreguard my last message. After I closed the file and reopened it then attempted to get into the vba code it asked for the password.
    Thanks DRJ
    Please mark it solved.

  5. #5
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    You should know that this is not a fool-proof way to protect your code but it will keep out most average users....

    thread marked solved
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  6. #6
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Yea, you have to save and close for it to take effect.

    Glad to help

    Take Care

Posting Permissions

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