Excel OPEN FILE Processing





techstore
LQ Net Home








   Excel Links

Display an OpenFile Dialog Box

printpage    Printer Friendly Page

The following code can be used to display an OpenFile dialog box.
This allows the user to select the workbook to be processed.




Application.GetOpenFileName will display an open dialog box.

FILEX is a variable that will contain the name and path of the selected file.

If a file was not selected, FILEX will be false.

DIR(filex) will return the file name portion of the file in filex.



FileFilters describe which files are displayed in the Open File dialog


Examples of Filter Statements
FileFilter:="Microsoft Excel Files (*.xls), *.xls"
FileFilter:="Text Files (*.txt), *.txt"
FileFilter:="Add-In Files(*.xla), *.xla"
FileFilter:="Text Files (*.txt), *.txt", Add-In Files(*.xla), *.xla"
The above will list both filters in the drop-down box
FileFilter:="Visual Basic Files(*.bas; *.txt), *.bas; *.txt"
Semi-colons separate multiple file types for a single filter type


















Copyright © 2006-2009, LQ Systems,Inc. All rights reserved.