Dim files() As String, str
As String
Dim path As String, N As Integer
With CommonDialog1
.Flags = &H200
.Filter = "All
Files|*.*"
.ShowOpen
End With
str = CommonDialog1.FileName
N = Len(str)
Do While N > 0
N = InStr(str, "\")
str = Mid(str, N + 1, Len(str))
Loop
files = Split(Trim(str), " ")
Debug.Print UBound(files, 1) + 1