Posted on 2011-02-16
I am trying to set filters for a FileSaveAs dialog using the following code:
Dim fDialog As Office.FileDialog
Dim varSelection As Variant
Dim strFileName As String
Set fDialog = Application.FileDialog(msoFileDialogSaveAs)
.Title = "Select Destination File"
.InitialFileName = CurrentProject.Path & "\test.pdf"
.Filters.Add "PDF Files", "*.PDF"
I get an error on the .Flters.Clear line, as well as the Filters.Add line. Everything works fine without those lines of code, but of course I don't get my desired filter. What am I missing?