FileDialog Can't Navigate

eaaxelrad

New Member
Joined
Mar 31, 2011
Messages
3
Here is a snippet of code I use for the FileDialog

Dim fDialog As Office.FileDialog
Dim varFile As Variant
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)

The problem I am having is I can't navigate around inside the dialog box. I can't click on "My Documents", I can't move up a folder, nothing. Is there a setting that will allow for navigating?

Thanks.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
This code just defines the dialog box. Can you show us the rest of the code - where you actually open the dialog box?
 
Upvote 0
OK. Here is the entire code:
Dim fDialog As Office.FileDialog
Dim varFile As Variant
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
.AllowMultiSelect = False
.Title = "Please select <file text="">"</file>
.Filters.Clear
.Filters.Add "Text", "*.txt"
.Filters.Add "Comma Separated", "*.csv"
.Filters.Add "Excel 97-2003", "*.xls"
.Filters.Add "Excel 2010", "*.xlsx"
.Filters.Add "All Files", "*.*"

If .Show = True Then
For Each varFile In .SelectedItems
MsgBox varFile
Next
Else
MsgBox "You clicked Cancel in the file dialog box."
End If
End With
 
Upvote 0
Your code works perfectly here without any changes. I can navigate around, select "My Documents", select a single file, and the filename is reported in the message box. When I click Cancel, it tells me I clicked Cancel.

So it's not the code which is at fault, I would say.
 
Upvote 0
:lookaway:
Yeah. It started working for me this morning. I don't know what was going wrong with my machine here but I am a little embarrassed. Thank you so much for responding quickly.
 
Upvote 0
Check the date. Did it start working at midday? :)

Excel has a sense of humour!
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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