File Dialog - Filters.Add does not work in Excel for Office 365

Mike2

New Member
Joined
Jan 5, 2019
Messages
43
Hello,

Has anyone encounter a Run Time Error 438 - Object doesn't support this property or method
when running VB code for File Dialog - Filters.Add in Excel for Office 365?

Typical codes:
Code:
Set fd = Application.FileDialog(msoFileDialogFolderPicker)
With fd
   .ButtonName = "Select"
   .Filters.Add "All Files", "*.*"
   .InitialView = msoFileDialogViewDetails 
   .Show
End with

When i exclude Filters.Add "All Files", "*.*" in my code,
the File Dialog window does not show any file to select.

The code works fine without error in Excel 2010.

Your expertise to resolute this issue is greatly appreciated...thanks.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
your dialog is set to select Folders, while you need files. change to this:
Code:
set fd=Application.FileDialog ([COLOR=#ff0000]msoFileDialogFilePicker[/COLOR])
 
Upvote 0
Oh geeze, i have chosen the wrong selection in the pop up menu...no wonder the code did not work.
Thank you so much for catching the error, @bobsan42.
 
Upvote 0

Forum statistics

Threads
1,224,885
Messages
6,181,586
Members
453,055
Latest member
cope7895

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top