Filedialog err 438 Object doesn't support this property or method

A

Aref Mikati

In the following code, the Filters.Add method is, from time to time, raising
err 438.
Any suggestions?
Set fd = Application.FileDialog(msoFileDialogOpen)
With fd
.AllowMultiSelect = False
.ButtonName = "Open"
.Title = gstrDefaultTitle & " - Project: " & Mid(strInitialFileName,
4, 3)
.Filters.Clear
.Filters.Add "All Files", "*.*", 1
.Filters.Add "Images", "*.gif; *.jpg; *.jpeg; *.tif; *.pdf", 2
.FilterIndex = 2
.InitialView = msoFileDialogViewDetails
.InitialFileName = strInitialFileName
If .Show = -1 Then
Application.FollowHyperlink .SelectedItems(1)
End If
End With
Set fd = Nothing ' Dim dummy As Boolean
 
A

Aref Mikati

Both .Filters.Add lines were generating the error. (only sometimes and I
could not establish when)
I will try the API. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top