Open Multiple Password Protected Workbooks with Macro

Discussion in 'Microsoft Excel Programming' started by ScottMSP, Mar 27, 2008.

  1. ScottMSP

    ScottMSP Guest

    Hello -

    I have scoured the discussions boards, but have not found an answer to my
    question and thus this post.

    I have 10 workbooks that are each individually password protected with
    unique passwords that I would like to be able to open all 10 at once using a
    Macro.

    I want to avoid having to individually click on and open each workbook and
    key the unique password.

    I plan for this to be part of a broader Macro doing other steps, but I have
    not been able to find the solution to this part of the problem.

    Thanks in advance.
     
    ScottMSP, Mar 27, 2008
    #1
    1. Advertisements

  2. ScottMSP

    Tom Hutchins Guest

    You can provide the password with the Workbooks.Open method, like this:

    Workbooks.Open Filename:="D:\Data\Book1.xls", Password:="asd"
    Workbooks.Open Filename:="D:\Data\Book2.xls", Password:="bnm"
    Workbooks.Open Filename:="D:\Data\Book3.xls", Password:="cvb"
    'etc.

    Does that do what you want?

    Hutch

    "ScottMSP" wrote:

    > Hello -
    >
    > I have scoured the discussions boards, but have not found an answer to my
    > question and thus this post.
    >
    > I have 10 workbooks that are each individually password protected with
    > unique passwords that I would like to be able to open all 10 at once using a
    > Macro.
    >
    > I want to avoid having to individually click on and open each workbook and
    > key the unique password.
    >
    > I plan for this to be part of a broader Macro doing other steps, but I have
    > not been able to find the solution to this part of the problem.
    >
    > Thanks in advance.
    >
    >
     
    Tom Hutchins, Mar 27, 2008
    #2
    1. Advertisements

  3. ScottMSP

    ScottMSP Guest

    Yes... it almost seems too simple, but it definitely worked. I can use it as
    a part of the larger macro. Thank you!

    "Tom Hutchins" wrote:

    > You can provide the password with the Workbooks.Open method, like this:
    >
    > Workbooks.Open Filename:="D:\Data\Book1.xls", Password:="asd"
    > Workbooks.Open Filename:="D:\Data\Book2.xls", Password:="bnm"
    > Workbooks.Open Filename:="D:\Data\Book3.xls", Password:="cvb"
    > 'etc.
    >
    > Does that do what you want?
    >
    > Hutch
    >
    > "ScottMSP" wrote:
    >
    > > Hello -
    > >
    > > I have scoured the discussions boards, but have not found an answer to my
    > > question and thus this post.
    > >
    > > I have 10 workbooks that are each individually password protected with
    > > unique passwords that I would like to be able to open all 10 at once using a
    > > Macro.
    > >
    > > I want to avoid having to individually click on and open each workbook and
    > > key the unique password.
    > >
    > > I plan for this to be part of a broader Macro doing other steps, but I have
    > > not been able to find the solution to this part of the problem.
    > >
    > > Thanks in advance.
    > >
    > >
     
    ScottMSP, Apr 1, 2008
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay Oken

    linking to multiple password protected workbooks

    Jay Oken, Mar 19, 2005, in forum: Microsoft Excel Programming
    Replies:
    1
    Views:
    301
    Dave Peterson
    Mar 19, 2005
  2. Guest

    macro to batch fix errors on password protected workbooks

    Guest, Oct 6, 2005, in forum: Microsoft Excel Programming
    Replies:
    4
    Views:
    173
    Guest
    Oct 7, 2005
  3. Dmitry Kopnichev

    How to see macro code of a password protected macro without a password?

    Dmitry Kopnichev, Oct 27, 2005, in forum: Microsoft Excel Programming
    Replies:
    5
    Views:
    389
    Norman Jones
    Oct 27, 2005
  4. Guest

    Code to open multiple password protected workbooks

    Guest, Oct 11, 2007, in forum: Microsoft Excel Programming
    Replies:
    0
    Views:
    178
    Guest
    Oct 11, 2007
  5. BK
    Replies:
    0
    Views:
    266
Loading...

Share This Page