xlDialogOpen Argument


Posted by Glenn Koproske on June 04, 2001 1:35 PM

Here is my simple code for the user to select files to open:
If Application.Dialogs(xlDialogOpen).Show = False Then
Exit Sub
End If
It turns out that they checked the box, when they originally saved their spreadsheets, for Read Only Recommended. There is an argument for xlDialogOpen called IgnoreReadOnlyRecommended which can be set to True to not display Excel's message box for this annoyance.
For the life of me, I cannot find a way to pass this argument in my code.



Posted by Dax on June 04, 2001 1:58 PM

Hi,

I'm not sure if this argument can be used with the xlDialogOpen dialog box. However, you can use it with the Application.GetOpenFileName method e.g.

Sub Test()
Dim FileNm As String

FileNm = Application.GetOpenFilename("Microsoft Excel Files,*.xls", , "Open File...")

If FileNm <> "False" Then
Workbooks.Open FileNm, IgnoreReadOnlyRecommended:=True
End If

End Sub

HTH,
Dax.