+ Reply to Thread
Results 1 to 10 of 10

Unprotect VBA - Run Code - Protect again (password is known)

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Unprotect VBA - Run Code - Protect again (password is known)

    Hi,

    how would i proceed about that? I know the password and am running office 2007. Thanks!
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

  2. #2
    Forum Contributor
    Join Date
    10-21-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Unprotect VBA - Run Code - Protect again (password is known)

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Unprotect VBA - Run Code - Protect again (password is known)

    Hi Tejas,

    thanks for your reply. Perhaps i didn't make myself clear: I'd like to unprotect the vba project, not the worksheet/book.

    Thanks!

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Unprotect VBA - Run Code - Protect again (password is known)

    you need windows api functions to do that-I think I saw a thread on this at vba express recently
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Forum Contributor
    Join Date
    10-21-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: Unprotect VBA - Run Code - Protect again (password is known)

    Hi,

    I am surprised that why do you need to unprotect VBA project code to run the macro? Code can run without that too.

    And if you really need it, I don't think it is possible.

  6. #6
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Unprotect VBA - Run Code - Protect again (password is known)

    Well, I think it's quite easy to think of a need for that: Many employees have a complex file with a vba code "hidden" within. I'd like to change the code a bit(got that one figured out), without giving the password to everyone.

    I found one solution, which unfortunately can't be used in my case since many users have their own personal modules, while other dont +solver etc.

    Please Login or Register  to view this content.
    I'll take a look for a API solution... thanks

    ps: I can't just send a new file to all users since the file contains user input for multiple entries.

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Unprotect VBA - Run Code - Protect again (password is known)

    found it: http://www.vbaexpress.com/forum/showthread.php?t=43809
    based on some old code by the late Howard Kaikow

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Unprotect VBA - Run Code - Protect again (password is known)

    this is why it is recommended to separate code from data-so you can just distribute a new code workbook or add-in ;-)

  9. #9
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Unprotect VBA - Run Code - Protect again (password is known)

    thanks a lot! Sometimes it's just impossible to separate the code from the file I'm afraid.

  10. #10
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Unprotect VBA - Run Code - Protect again (password is known)

    I reckon that's pretty unlikely-difficult, sure, but not impossible and if you have a regular need to update the code you really ought to investigate the possibility ;-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1