+ Reply to Thread
Results 1 to 6 of 6

Code to open read only file and fill in password

  1. #1
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Waterbury, CT
    MS-Off Ver
    Office 365
    Posts
    1,175

    Code to open read only file and fill in password

    Hey everybody!
    Below you will see a code I wrote that opens a file which is in read only (since a different user always has it opened) and should enter the password since it is password protected. The problem is that the "enter password" box keeps popping up and the code doesn't write the passcode for me? I did, however, have the user close his workbook and I modified the code to open the workbook normally with out any code to automatically hit "ok" on the dialog box which no longer pops up since it is not read only anymore and the code worked fine. But I need the code to work when the file is read only. Can anyone help me on this? Thanks in advance:-)

    Please Login or Register  to view this content.
    Last edited by kosherboy; 01-20-2014 at 02:51 PM.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Code to open read only file and fill in password

    Maybe:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Waterbury, CT
    MS-Off Ver
    Office 365
    Posts
    1,175

    Re: Code to open read only file and fill in password

    Hi xladept,
    Thanks for responding. I inserted your code but can you please modify it because when I pasted your code excel marked some of your scripts in red. I'm sorry to trouble you.
    Thanks.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Code to open read only file and fill in password

    Sorry about that red:

    Please Login or Register  to view this content.
    But it's still maybe!

  5. #5
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Waterbury, CT
    MS-Off Ver
    Office 365
    Posts
    1,175

    Re: Code to open read only file and fill in password

    Thanks. No more red-thank you! But it didn't work

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Code to open read only file and fill in password

    Bummer!...........

+ 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. Replies: 0
    Last Post: 10-02-2013, 01:47 AM
  2. vba password code to prevent excel file upon open
    By banadh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-04-2012, 12:29 PM
  3. Skip The Read Only Prompt When I Open A File - Excel, Open it read-write instead.
    By harry_1805 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2012, 02:14 AM
  4. Replies: 0
    Last Post: 04-26-2006, 10:25 PM
  5. [SOLVED] can't open password protected file as read-only
    By ClemM in forum Excel General
    Replies: 0
    Last Post: 01-10-2006, 12:40 PM

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