I'm running into an error when I attempt to add filters to a FileDialog.
I've tried to troubleshoot this with multiple posts / articles but nothing seems to have solved it. The online documentation identifies using .Filters.Add but it doesn't seem that .Filters is an appropriate method. .Filter.Add is at least recognized but is still invalid. .Filter.Clear is also recognized but is invalid as well.
Code:
Private Sub Command93_Click()
Dim objFD As Object, strOut As String
Set objFD = Application.FileDialog(2)
With objFD
.Filter.Clear
.Filter.Add "Excel File", ".xls"
If objFD.show = -1 Then
strOut = objFD.selecteditems(1)
End If
End With
Set objFD = Nothing
Me.txtSaveFile = strOut
Me.Refresh
End Sub