+ Reply to Thread
Results 1 to 4 of 4

Password protecting many workbooks

  1. #1
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    Password protecting many workbooks

    Hello - - I've used this bit of code before that worked just fine in setting an active workbook with a pasword:

    Please Login or Register  to view this content.
    My question would be is there a way I can modify this code to set a password on the workbook that is NOT open? I have a monthly routine where by I'll have to open 16 workbooks and issue a 'save as' with a password. I was hoping someone might have a thought/suggestion on how I could do this without opening each of the 16 workbooks (at least manually). If someone might have one example I could duplicate that 16 times. Thanks again and may you all have a happy New Year!
    Last edited by Ironman; 12-28-2011 at 04:56 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Password protecting many workbooks

    Hello Ironman,

    For security reasons, Excel does not allow you to open, change or access a password in closed workbook. The workbook must first be opened before the password can changed or removed.

    If you have a main workbook that opens the files via code then you can automate the process of "Saving As" with a password for each workbook. You would need to provided more information and/or code before I can give you a specific example.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: Password protecting many workbooks

    Thanks Leith for the reply - - I did find a solution. I have what I call a 'master report' excel file that I use to store and run various vba code from the personal.xls file...below is what I've done for two test files, works great...so I would just duplicate the one section 16 times and change the file name to open and then add a password to, then close the file...then move onto the next file (open/save as with password/close)...Here is a copy of my code:

    Please Login or Register  to view this content.
    Happy New Year!

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Password protecting many workbooks

    If you workbooks are named Test1, Test2 etc then this might be better

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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