Runtime 438 Object doesn’t support this property or method

LB79

Registered User.
Local time
Today, 12:27
Joined
Oct 26, 2007
Messages
505
Hello,

I've been using this bit of code for a while now and I'm sure it worked a week ago, but suddenly its not.
I'm getting Runtime error 438 Object doesn’t support this property or method.
Can anyone help?

Thanks


Public Sub ExpFile_Excel()
Mth = Format(Now, "YYYYMM")
Dte = Format(Now, "YYYYMMDD")
Tme = Format(Now, "HH-MM-SS")
Set FDialog = Application.FileDialog(msoFileDialogSaveAs)
With FDialog
.AllowMultiSelect = False
.InitialFileName = FileName
.Title = "ATMT: Please select a save location"
.Filters.Clear
.Filters.Add "Microsoft Excel 2003", "*.xls"
.Filters.Add "Microsoft Excel 2007", "*.xlsx"
.Filters.Add "Microsoft Excel 2007", "*.xlsm"
If .Show = True Then
For Each varFile In .SelectedItems
DestFile = .SelectedItems(1)
Next
End If
End With
End Sub
 
Hi - it highlights:

.Filters.Add "Microsoft Excel 2003", "*.xls"

Thanks
 
I don't think you can specify filters in the FileDialog Save As type.
 
Ive used them in this way before.
 
Just like the error message says, the object doesn't support the property. You may have used it in a different environment besides Access.
 
Just realised where I used it - For importing files in this way not exporting. It works for importing.

Thanks for helping me see sense.
 
That would be the FilePicker - msoFileDialogFilePicker

Glad you got that clarified.
 

Users who are viewing this thread

Back
Top Bottom