Make VBA open a browser window

F

Frans Verhaar

Hi,

I have this code in VBA that calls a query table from a certain csv file.
However, the name of this csv file is not constant.
Therefore I would rather like VBA to open a browser screen that shows all
csv files in a specific folder, where the user can just double click the
file that is needed as a source for the query table.

How can I let VBA open a browser window and show me all available CSV files?

Thanks,
Frans
 
P

Piotr Lipski

Hi,

I have this code in VBA that calls a query table from a certain csv file.
However, the name of this csv file is not constant.
Therefore I would rather like VBA to open a browser screen that shows all
csv files in a specific folder, where the user can just double click the
file that is needed as a source for the query table.

How can I let VBA open a browser window and show me all available CSV files?

With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.Filters.Add "csv files", "*.csv"
.Show
If .SelectedItems.Count > 0 Then MsgBox .SelectedItems.Item(1)
End With
 
F

Frans Verhaar

Thanks, that works.

Piotr Lipski said:
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.Filters.Add "csv files", "*.csv"
.Show
If .SelectedItems.Count > 0 Then MsgBox .SelectedItems.Item(1)
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top