Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Jun 2003
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatically Selecting 'Read Only' (Excel 2000)

    Hi All,
    I'm opening an excel workbook from a button in another workbook. The workbook that is being opened is write-protected. I want this macro/button to always select the "Read Only" option. I do not want the user to even see the dialog box asking for a password. Is it possible to do this?
    Thanks,
    --cat

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Automatically Selecting 'Read Only' (Excel 2000)

    How about using the readonly parameter:
    <pre>workbooks.Open _
    filename:="c:filename.xls", _
    readonly:=true</pre>


    I assume the file does NOT require a password to open, otherwise you will still be prompted for that unless you want to add the password in the code:
    <pre>workbooks.Open _
    filename:="c:filename.xls", _
    readonly:=true, _
    password:="password"</pre>



    Steve

  3. #3
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,820
    Thanks
    133
    Thanked 481 Times in 458 Posts

    Re: Automatically Selecting 'Read Only' (Excel 2000)

    You need to include
    ReadOnly:=True
    after your VBA workbook open command
    For example:

    zFile = "xxxxxxxxxxx.xls"
    workbook.open filename:=zFile, ReadOnly:=True, Pasword:= "xxxxx"

    zeddy

  4. #4
    Lounger
    Join Date
    Jun 2003
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically Selecting 'Read Only' (Excel 2000)

    Thanks guys ... you are very very helpful.
    --cat

Posting Permissions

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