Hello gentlemen:
I have been seeing here at the forum you vary explanations on OPENING FILE (Dialog...)
But when it is MULTISELECT=TRUE, the box dialogues it is different from MULTISELECT=FALSE...
A code that I adapted for my needs in EXCEL, proceeds it would like somebody to turn possible your execution in AutoCAD...
Test in Excel to see the operation...
''''''''''''''''''''''''''' It follows the Code... '''''''''''''''''''''''''
''sub routine to extract the name of the directory...
Function FolderName(InputString As String, ReturnFileName As Boolean) As String
Dim i As Integer
i = 0
While InStr(i + 1, InputString, Application.PathSeparator) > 0
i = InStr(i + 1, InputString, Application.PathSeparator)
Wend
FolderName = Left(InputString, i - 1)
End Function
''Main routine
Sub ListFiles()
Dim filexlsimport As Variant
Dim i As Integer
Dim r As Integer
Dim path As String
Dim listfiles As String
path = ""
listfiles = ""
r = 1
filexlsimport = Application.GetOpenFilename("Drawing Files (*.dwg), *.dwg", , "Select the drawings to list", , True)
On Error Resume Next
If Left(CVar(filexlsimport), 1) <> "F" Then
For i = 1 To UBound(filexlsimport)
If path = "" Then
path = FolderName(CStr(filexlsimport(i)), False) & "\"
End If
If r = 1 Then
listfiles = "(list" & listfiles & " " & Chr(34) & CStr(filexlsimport(i)) & Chr(34)
Else
listfiles = listfiles & " " & Chr(34) & CStr(filexlsimport(i)) & Chr(34)
End If
r = r + 1
Next i
listfiles = listfiles & ")"
MsgBox listfiles
End If
End Sub
''''''''''''''''''''''''''''''''''''''''''''' end of routine ''''''''''''''''''''''''''''''''''''''''''
Thank you!
Emanuel