Originally Posted by
sheeeng
Hi all,
Can anyone tell me how to customize the dialog box of Get Open FileName?
How to use the syntax below?
eg. I only would like to open file with the extension of *.abc or *.xyz? How should we write it?
Thanks.
Dim fName As Variant
Dim Sep As String
fName = Application.GetOpenFilename _
(filefilter:="ABC Files (*.abc), *.*, All Files (*.*), *.*")
If fName = False Then
MsgBox "No File Selected"
Exit Sub
End If
Dim fName As Variant
Dim Sep As String
fName = Application.GetOpenFilename _
(filefilter:="ABC Files (*.abc),*.abc, XYZ Files (*.xyz),*.xyz")
If fName = False Then
MsgBox "No File Selected"
Exit Sub
End If
They appear as separate entries in the drop-down. To get both at once, use
Dim fName As Variant
Dim Sep As String
fName = Application.GetOpenFilename _
(filefilter:="Sheeng's Files (*.abc;*.xyz),*.abc;*.xyz")
If fName = False Then
MsgBox "No File Selected"
Exit Sub
End If