ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Make VBA open a browser window (https://www.excelbanter.com/excel-programming/365129-make-vba-open-browser-window.html)

Frans Verhaar

Make VBA open a browser window
 
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



Piotr Lipski

Make VBA open a browser window
 
On Thu, 22 Jun 2006 20:54:06 +0200, Frans Verhaar wrote:

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

--
PL

Frans Verhaar

Make VBA open a browser window
 
Thanks, that works.

"Piotr Lipski" wrote in
message . ..
On Thu, 22 Jun 2006 20:54:06 +0200, Frans Verhaar wrote:

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

--
PL




Frans Verhaar

Make VBA open a browser window
 
Thanks a lot Piotr. It works fine!
Regards,
Frans

"Piotr Lipski" wrote in
message . ..
On Thu, 22 Jun 2006 20:54:06 +0200, Frans Verhaar wrote:

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

--
PL





All times are GMT +1. The time now is 12:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com