The fisrt iitem in the list will contain the path so you can either remove it or use it to create a full path for the other list items
Code:
Private Sub cmdOpen_Click()
Dim Counter As Long
Dim FileNames As String
Dim Length As Long
Dim Start As Long
CommonDialog1.Filter = "All Files|*.*"
CommonDialog1.FilterIndex = 0
CommonDialog1.Flags = MSComDlg.cdlOFNExplorer Or MSComDlg.cdlOFNAllowMultiselect Or MSComDlg.cdlOFNFileMustExist Or MSComDlg.cdlOFNHideReadOnly Or MSComDlg.cdlOFNPathMustExist
CommonDialog1.ShowOpen
FileNames = CommonDialog1.filename
If FileNames = "" Then
Exit Sub
End If
' Unpack the file names
Length = VBA.Len(FileNames)
Counter = 1
Start = 1
While Counter < Length
While Mid(FileNames, Counter, 1) <> Chr(0) And Counter < Length
Counter = Counter + 1
Wend
List1.AddItem Trim(Mid(FileNames, Start, Counter - Start))
Counter = Counter + 1
Start = Counter
Wend
End Sub
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company