+ Reply to Thread
Results 1 to 4 of 4

VBA code to open protected shared file

  1. #1
    Registered User
    Join Date
    09-02-2013
    Location
    Posen
    MS-Off Ver
    Excel 2010
    Posts
    6

    VBA code to open protected shared file

    Hi

    I have a problem with creating a macro that will automatically open a password-protected, shared file *. xls

    The following code works only for a file that is not shared
    In the case of shared file is still asked for the password (x2)


    Set xWb = New Excel.Application

    xWb.Visible = True
    xWb.DisplayAlerts = False

    wbPath = ThisWorkbook.path & "\Sheet1.xls"

    xWb.Workbooks.Open Filename:=wbPath, Password:="password"


    Do you have any ideas?

    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA code to open protected shared file

    you could possible try workbooks.open filename:=wbPath, Password:="password", writerespassword:="password

  3. #3
    Registered User
    Join Date
    09-02-2013
    Location
    Posen
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: VBA code to open protected shared file

    Thanks for your answer.

    Unfortunatly this does not solve the problem
    The password prompt still shows up

    Still trying to find a solution

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA code to open protected shared file

    I'd expect you might need to solve this using sendkeys. I don't think there is anything else in the open method to deal with that.

+ 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. How to open a protected workbook from VBA code?
    By khalidlblid in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-03-2013, 06:25 AM
  2. Replies: 4
    Last Post: 10-21-2012, 06:00 PM
  3. VBA for excel 2003. Open file dialog box, open 2007 file xlsx, continue with code
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2011, 12:12 AM
  4. [SOLVED] Open File to Protected
    By maperalia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2005, 02:05 AM
  5. Shared, Protected File with Filters?
    By BarryLCook1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2005, 10:49 AM

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