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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
The FileDialog is not really usable in Access.

You don't indicate which line causes the error, but using save rather than
open will give the error. There could be other points where it would fail as
well.

Use the API call instead:
http://www.mvps.org/access/api/api0001.htm
 
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

Back
Top