hi, i am trying to use the built in FileDialog, and the general impression i get is that it is pretty crappy, and i am having that experience.
i am trying to allow someone to save an exported text file, but i am getting an error about the Filters line saying:
Object does not support this method or property.
now when i typed the . Filters was in the list as well as Add before the second dot, so i am having a hard time figuring out how this object doesn't support the property that is in the list, but whatever, this is microsoft and maybe i shouldn't understand this....
anywho, all i really want is an easyish way of allowing a user to select a file and location (like the file dialog looks like it provides), and store that in a variable that i can pass to TransferText.
i am trying to allow someone to save an exported text file, but i am getting an error about the Filters line saying:
Object does not support this method or property.
now when i typed the . Filters was in the list as well as Add before the second dot, so i am having a hard time figuring out how this object doesn't support the property that is in the list, but whatever, this is microsoft and maybe i shouldn't understand this....
Code:
Dim selectedPath As Variant
Dim dlgSaveAs As FileDialog
Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)
With dlgSaveAs
.AllowMultiSelect = False
.Filters.Add "Text File", "*.txt"
If dlgSaveAs.Show = True Then
For Each selectedPath In .SelectedItems
MsgBox selectedPath
Next
Else
MsgBox "Cancelled"
End If
End With
anywho, all i really want is an easyish way of allowing a user to select a file and location (like the file dialog looks like it provides), and store that in a variable that i can pass to TransferText.