Databases Reference
In-Depth Information
FIGURE 2.1
A standard open file dialog box.
file open dialog box will display upon opening (Figure 2.1). Common filters utilized in addition
to the standard *.xls are: (*.xlt, *.csv, *.txt). The following function allows all of the above
parameters to be set, which affords the developer a great deal of flexibility.
Function LoadWithDialog(ByVal filters$, ByVal defaultdir$,
ByVal WindowCaption$) As String
'Function to Load files of type specified with Dialog Box
'Returns the name of the Workbook Loaded
Dim vFileName As String
Dim nochoice As Integer
Dim fillen As Integer
Dim strike As Integer
Dim ErrorBoxCaption$, ErrorBoxMsg$
On Error GoTo FileOpenErr
'Set Up Captions and Messages
ErrorBoxCaption$ = "You must choose a File"
filters$ = LCase(filters$)
fillen = Len(filters$)
If fillen Mod 3 = 0 Then
'if valid filters then process
For ii = 1 To fillen Step 3
Search$ = Mid(filters, ii, 3)
'Stop
GoSub Build_Filters
Next ii
Search WWH ::




Custom Search