Results 1 to 4 of 4

Thread: VBA - Opening password protected workbook?
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Oct 2006
    Posts
    202
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default VBA - Opening password protected workbook?

    Hi

    I need to open a password protected workbook using VBA.

    I've tried the code below but I still get prompted for a password.

    Code:
    Workbooks.Open Filename:="\\HOME\Working\Report.xls" _
            , Password:="xxxx"
    How do I get it to open automatically???

  2. #2
    MrExcel MVP
    Moderator
    Inactive
    Richard Schollar's Avatar
    Join Date
    Apr 2005
    Location
    UK
    Posts
    23,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Default

    Hi

    That should work for a workbook that's password protected to open, is it possibly password protected for writing instead (or as well as)?
    Richard Schollar

    Using xl2013

  3. #3
    Board Regular
    Join Date
    Apr 2007
    Posts
    169
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Is there also a Write-Reserved Password on the file? i.e. does it ask you whether you want to open it as read only? If so, you also need to include WriteResPassword:="xxxx"

  4. #4
    Board Regular
    Join Date
    Oct 2006
    Posts
    202
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Ok, thanks, I just worked that out myself too.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •