Here is some code to create an OPEN FILE dialog box (file browser).
Just change csv to anything else for other file extensions.
Just change csv to anything else for other file extensions.
Code:
Directory$="C:\CSVDirectory" '<-- Directory where csv files are saved
temp = Dir( Directory$+"*.csv" )
count = 0
While temp <> ""
count = count + 1
temp = Dir
Wend
Dim x() As String
ReDim x(count)
DD$ =Dir( Directory$+"*.csv")
LD=Len(DD$)
FileList$(0)=Left$(DD$,LD)
For i = 1 To count-1
DD$=Dir
LD=Len(DD$)
FileList$(i) = Left$(DD$,LD)
Next i
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Begin Dialog GETCSVDIALOG 130,40,200,130, "Get CSV File"
Text 20,4,50,8,"Select File"
ListBox 12,15,80,100,FileList$(),.LstBox
OKButton 95,14,37,12
CancelButton 95,30,37,12
End Dialog
Dim dlg As GetCSVDialog
Button = Dialog(dlg)
If Button = True Then
FileName$=Directory$+FileList$(dlg.LstBox)
Else
End
End If
Open FileName$ For Input As #1
-
-
-
-
Close #1