+ Reply to Thread
Results 1 to 4 of 4

Thread: Password protecting a workbook prevents Macros from working.

  1. #1
    Registered User
    Join Date
    12-29-2011
    Location
    Tasmania, Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Password protecting a workbook prevents Macros from working.

    Hi,

    I am using Excel 2007. When I protect a multi-sheet workbook with a password, the Macros within the workbook cease to function. They will only function when the workbook is either unprotected or protected without using a password.

    Would appreciate help.

    Thanks.

  2. #2
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,224

    Re: Password protecting a workbook prevents Macros from working.

    1) Read up on employing the UserInterfaceOnly:=True parameter in a VBA-based "protect" command. This will allow all other VBA to continue to function if this parameter is set when the sheet(s) are protected.

    This flag will have to be reset each time the workbook is opened, too, as it does not persist when the workbook is closed.

    2) Teach your macros the password and let them unprotect the sheet, run their code, protect again when finished.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    12-29-2011
    Location
    Tasmania, Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Smile Re: Password protecting a workbook prevents Macros from working.

    Thanks Jerry; I will give it a shot and let you know how it goes.

    Regards,

    Peter

  4. #4
    Valued Forum Contributor OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,647

    Re: Password protecting a workbook prevents Macros from working.

    For what it is worth, I would recommend option 2 over option 1, which is not 100% reliable in my experience.
    Good luck.

+ 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.2.0