Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change VBA Project password (2003)

    Is there a way to change a VBA Project password programatically. I know how to Unprotect and Protect a VBA Project, but once the project is protected I can't change it.

    Please help.
    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change VBA Project password (2003)

    Now wouldn't virus writers love that! <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

    There is no programmatic access to the VBA project password for security reasons. You could try manipulating the project properties dialog using SendKeys, but that's rather shaky.

    There is some code here: Setting VBA Project Password but I haven't tried it.

  3. #3
    Lounger
    Join Date
    Jan 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change VBA Project password (2003)

    Hans,

    I was able to change the password with the following SendKey:

    SendKeys "%{F11}%TE" & oldPassword & "~^{TAB}%P" & newPassword & "{TAB}" & newPassword & "~~%{F11}", True

    Regards

Posting Permissions

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