Case
:
############ Kurzfassung #########
Private
Declare
Function
SearchTreeForFile
Lib
"imagehlp.dll"
_
(
ByVal
RootPath
As
String
, _
ByVal
InputPathName
As
String
, _
ByVal
OutputPathBuffer
As
String
)
As
Long
Const
strFile
As
String
=
"lobbyliste.xls"
Sub
Test()
Dim
strPathName
As
String
* 255
Dim
strName
As
String
Dim
lngTMP
As
Long
On
Error
GoTo
Fin
lngTMP = SearchTreeForFile(
"C:\users\office"
, strFile, strPathName)
If
lngTMP = 0
Then
Debug.Print
"Datei nicht vorhanden"
Else
Debug.Print strPathName &
"|"
strPathName = Left$(strPathName, _
InStr(1, strPathName, vbNullChar) - 1)
strName = RTrim(strPathName)
Debug.Print strName
End
If
Fin:
If
Err.Number <> 0
Then
MsgBox
"Fehler: "
& _
Err.Number &
" "
& Err.Description
End
Sub