View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
eggpap eggpap is offline
external usenet poster
 
Posts: 29
Default FileDialog Filters.clear

I have the following "classical" code to use a filedialog control in Excel
2003:

Function FileSelector(tipo As Integer)
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogSaveAs)

Dim vrtSelectedItem As Variant

With fd
.Filters.Clear
.Filters.Add "MyCustomFiles", "*.trn"

If .Show = -1 Then

For Each vrtSelectedItem In .SelectedItems
FileSelector = vrtSelectedItem
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing

End Function

It performs correctly without the .Filters statements. With them, instead, I
get the following error:

Property or method not supported by the object

I use Excel 2003/SP3

Any help?

Thanks