+ Reply to Thread
Results 1 to 7 of 7

Need help writing code to unprotect multiple WBs with same password

  1. #1
    Registered User
    Join Date
    11-02-2020
    Location
    USA
    MS-Off Ver
    2016
    Posts
    4

    Need help writing code to unprotect multiple WBs with same password

    Hi there,

    Second time posting this here because it's been over a week with no replies on the first, I am wondering if there is a way to mass-unprotect multiple workbooks at once. I basically have one directory, and all of the individual .xlsm files are in there. There are around 400 individual workbooks, some of which are protected, while others are not. Of the ones that are protected, all of them have the same password. Can someone help me figure out a way to unprotect all of them at once? I am still really new to VBA, so a breakdown of what's going on in the code comments would be really nice too.

    Thank you!

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Need help writing code to unprotect multiple WBs with same password

    you probably can't. you have to be inside a book to issue the transaction you're talking about.

  3. #3
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Need help writing code to unprotect multiple WBs with same password

    I have to disagree with. We can write code in a workbook that is placed in the directory and execute that code. I'm working on a solution.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Need help writing code to unprotect multiple WBs with same password

    What kind of protection are you referring to - password to open, or modify, or protection of workbook structure/windows?
    Remember what the dormouse said
    Feed your head

  5. #5
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Need help writing code to unprotect multiple WBs with same password

    Quote Originally Posted by maniacb View Post
    I have to disagree with. We can write code in a workbook that is placed in the directory and execute that code. I'm working on a solution.
    are you talking to me? if so, I didn't understand anything you said.

  6. #6
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Need help writing code to unprotect multiple WBs with same password

    Sorry vba_php, I now realize that Rory's answer need to be answered first. my bad.

  7. #7
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Need help writing code to unprotect multiple WBs with same password

    Here is what I was thinking could work, but it depends on the type of protection, and if there are multiple sheets.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to handle error code when wrong password is entered for unprotect worksheet?
    By redsab in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2020, 09:01 AM
  2. [SOLVED] Unprotect & Protect All workbook sheets password protection / existing code help needed
    By annazet in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2017, 04:51 PM
  3. vba code to unprotect excel sheet without password
    By annux08 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-06-2015, 07:46 AM
  4. Need help with a particular code - Unlock/Unprotect sheets with different password
    By mark182005 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-25-2015, 09:16 AM
  5. [SOLVED] Unprotect VBA - Run Code - Protect again (password is known)
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-10-2012, 09:35 AM
  6. code to unprotect sheet with password
    By BorisS in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-21-2006, 09:30 PM
  7. Please help!!! Using code to password-protect and unprotect...
    By Hawk in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-09-2005, 06:05 PM

Tags for this Thread

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