+ Reply to Thread
Results 1 to 11 of 11

Password array to open all password protected workbook in a folder

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003, 2010
    Posts
    73

    Password array to open all password protected workbook in a folder

    Hi guys, I've currently 10 excel password protected workbook in a shared drive with a master workbook with datas from each of the 10 workbook. Is it possible for me to create a macro in the master workbook whereby when the macro is invoked, all of the worksheets in all the 10 workbook will do what my code says? Currently my code is like what is shown below but it will prompt me password for all 10 workbook. Is it possible to have an array of password or something? such that I will not need to key in password after password for each of the10 workbooks individually. Thanks in advance.

    Please Login or Register  to view this content.
    Last edited by rename; 12-07-2012 at 05:09 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Password array to open all password protected workbook in a folder

    Hi -

    Look for
    Please Login or Register  to view this content.
    Regards,
    Event

  3. #3
    Registered User
    Join Date
    11-13-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003, 2010
    Posts
    73

    Re: Password array to open all password protected workbook in a folder

    But my password is different for each of the workbooks. The for loop will run the same password for all the workbooks which is invaild

  4. #4
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Password array to open all password protected workbook in a folder

    Hi -

    Put the password in variable, do a case statement or the like.

    Regards,
    Event

  5. #5
    Registered User
    Join Date
    11-13-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003, 2010
    Posts
    73

    Re: Password array to open all password protected workbook in a folder

    hi, can you be more specific? Sorry my vba is not good

  6. #6
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Password array to open all password protected workbook in a folder

    Hi -

    How is your file name constructed?


    Regards,
    Event

  7. #7
    Registered User
    Join Date
    11-13-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003, 2010
    Posts
    73

    Re: Password array to open all password protected workbook in a folder

    Book1,Book2,Book3 ... Etc
    Password for Book1 eg 111
    Book2 eg 123
    Book3 eg 321 etc..
    Last edited by rename; 12-06-2012 at 10:57 PM.

  8. #8
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Password array to open all password protected workbook in a folder

    Hi -

    Your code is not supported starting 2007 version, try this instead
    Please Login or Register  to view this content.
    Regards,
    Event

  9. #9
    Registered User
    Join Date
    11-13-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003, 2010
    Posts
    73

    Re: Password array to open all password protected workbook in a folder

    Hi, thanks for your help but I think i solved my problem. Here's the solution to it. Have a new sheet which store password for all the different workbooks and then add it into the for loop

    Please Login or Register  to view this content.

  10. #10
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Password array to open all password protected workbook in a folder

    Hi -

    Glad you solved it. 2 things I can comment

    1. If you get time to upgrade to 2007 and above, the file search will not work. so bookmark this thread for your future reference.
    2. Try renaming the file as well as your sheet wherein your password stored and see if the password still synced on the loop being open by the your script

    Regards,
    Event

  11. #11
    Registered User
    Join Date
    11-13-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003, 2010
    Posts
    73

    Re: Password array to open all password protected workbook in a folder

    Thanks for you advice. The file that excels open is in alphabetical order which means my password array for the file name must be in alphabetical order in order to execute properly. but no worries a simple macro will help me sort my file name and password table in ascending order to meet the order which excel opens my file. Thanks alot!

+ 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