Application.GetOpenFilename : GetOpenFilename « File Path « VBA / Excel / Access / Word






Application.GetOpenFilename

 
Sub ManyFiles()
    Dim x As Variant
    x = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls*), *.xls*",Title:="Choose Files", MultiSelect:=True)
    
    On Error Resume Next
    If x = "False" Then Exit Sub
    On Error GoTo 0
    
    For i = 1 To UBound(x)
        MsgBox "You selected " & x(i)
    Next i
End Sub

 








Related examples in the same category

1.Selecting multiple files
2.Load excel file
3.Get the selected file name in a file open dialog
4.Use filter in Open file dialog