Results 1 to 3 of 3
  1. #1
    Susy is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    134

    vba code to open and unprotect vba editor window (having the password)

    Hi there,



    is it possible to open and unlock (security) the vba editor from withing a form (click of a buttom). I just want to let some people to be able to access the overall code of the project without having to ALT+F11.

    Do you know of any code?

    Thanks in advance.

  2. #2
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    I don't think so. AFAIK, the vba object model does not expose the vbe for editing, which is probably a good thing. SendKeys might work, but it would be very unreliable. You'd have to embed the password in code, exposing it to anyone who might find the code unlocked by the last person who unlocked it. You cannot rely on db shutdown to run any code that would re-lock it on exit.
    Why not just either
    - provide the password to those whom you want to expose the code to so they can unlock it for viewing
    - dump the code to a document that only they can see/open
    - make the db an mde or accde?

    There seems to be exposure to the vb project, but it's properties are read only - not the code itself.
    https://msdn.microsoft.com/en-us/lib.../ff195749.aspx
    Last edited by Micron; 11-09-2016 at 10:19 AM. Reason: correction
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Susy is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    134
    Hi Micron,

    thanks for your contribution. As requested, I think I will just give the password to certain people.

    Thanks again.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 12-02-2014, 09:38 AM
  2. Open VBA editor
    By abhijeetkadam in forum Security
    Replies: 1
    Last Post: 11-19-2014, 08:10 AM
  3. Replies: 2
    Last Post: 01-15-2014, 07:57 PM
  4. Replies: 1
    Last Post: 06-29-2011, 07:22 AM
  5. VB Editor requires password
    By Desstro in forum Import/Export Data
    Replies: 7
    Last Post: 02-24-2011, 12:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums