Option
Explicit
Sub
Sample()
SelectMultipleFiles
"Z:\temp"
End
Sub
Sub
SelectMultipleFiles(sFolder
As
String
)
Dim
wb
As
WebBrowser
Dim
objExp
As
Shell32.Shell
Set
objExp =
New
Shell32.Shell
objExp.Open sFolder
Do
While
wb
Is
Nothing
:
Set
wb = GetExplorer(sFolder):
Loop
Call
wb.document.SelectItem(sFolder &
"\DateiA.xlsx"
, 5&)
Call
wb.document.SelectItem(sFolder &
"\DateiC.xlsx"
, 1&)
Call
wb.document.SelectItem(sFolder &
"\DateiE.xlsx"
, 1&)
End
Sub
Function
GetExplorer(sFolder
As
String
)
As
WebBrowser
Dim
objExp
As
New
Shell32.Shell
Dim
wb1
As
WebBrowser
For
Each
wb1
In
objExp.Windows
If
wb1.Name =
"Windows-Explorer"
And
_
LCase(wb1.document.Folder.Self.Path) = LCase(sFolder)
Then
Set
GetExplorer = wb1
End
If
Next
End
Function