+ Reply to Thread
Results 1 to 2 of 2

Default to Read Only

  1. #1
    KNg
    Guest

    Default to Read Only

    Hi,

    Please shed me light on the macro syntax to default the OpenFile option to
    'Read Only' when a dialog box is prompted for password-protected file.

    Thanks,
    Kenny.



  2. #2
    keepITcool
    Guest

    Re: Default to Read Only

    Kenny

    avoid the FileFind Dialog: you'll have no control

    use GetOpenFileName to get the user to tell you which file he wants.
    then have your code do it with all the verifications etc that you want..
    in this case few.. just the Readonly


    Sub OpenRO()
    Dim vFile As Variant
    vFile = Application.GetOpenFilename("Excel Files,*.xls")
    If vFile = False Then
    Beep
    Else
    Workbooks.Open vFile, ReadOnly:=True
    End If

    End Sub


    see VBA help for the methods..


    --
    keepITcool
    | www.XLsupport.com | keepITcool chello nl | amsterdam


    KNg wrote :

    > Hi,
    >
    > Please shed me light on the macro syntax to default the OpenFile
    > option to 'Read Only' when a dialog box is prompted for
    > password-protected file.
    >
    > Thanks,
    > Kenny.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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