View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default 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.