Following is a recursive procedure which will search all directories and all drives thru the last drive to search.
You would call it as follows:
ExcelPath = FindFile("EXCEL.EXE", "E"
This will search the C, D, and E drives for excel.exe
Public Function FindFile(rStr_FileName As String, rStr_LastDrive As String) As String
Dim pStr_FullPath As String
Dim pInt_DriveLetter As Integer
Dim pBol_FindFile As Boolean
pBol_FindFile = True
pInt_DriveLetter = 66
While (pBol_FindFile)
pInt_DriveLetter = pInt_DriveLetter + 1
pStr_FullPath = FindTheFile(Chr(pInt_DriveLetter) & ":", UCase(rStr_FileName))
If (Len(pStr_FullPath) > 0) Then
pBol_FindFile = False
Else
If (UCase(Chr(pInt_DriveLetter)) = rStr_LastDrive) Then
pBol_FindFile = False
End If
End If
Wend
FindFile = pStr_FullPath
End Function
'-------------------------------------------------------
Public Function FindTheFile(rStr_Parent As String, rStr_FileName As String) As String
Dim pStr_CurrentDir As String
Dim pStr_CheckFile As String
Dim pInt_Idx As Integer
Dim pBol_FileFound As Boolean
Dim pInt_FileType As Integer
Dim pCol_SubDirs As New Collection
If (Right(rStr_Parent, 1) <> "\"

Then
rStr_Parent = rStr_Parent & "\"
End If
pStr_CheckFile = Dir(rStr_Parent, vbDirectory)
pBol_FileFound = False
pStr_CurrentDir = ""
While (Len(pStr_CheckFile) > 0)
pStr_CheckFile = UCase(pStr_CheckFile)
If (pStr_CheckFile = "PAGEFILE.SYS"

Then
pStr_CheckFile = Dir
Else
If (Left(pStr_CheckFile, 1) = "."

Then
pStr_CheckFile = Dir
Else
pInt_FileType = GetAttr(rStr_Parent & pStr_CheckFile) And vbDirectory
If (pInt_FileType = vbDirectory) Then
pCol_SubDirs.Add (rStr_Parent & pStr_CheckFile)
pStr_CheckFile = Dir
Else
If (pStr_CheckFile = rStr_FileName) Then
pBol_FileFound = True
pStr_CurrentDir = rStr_Parent
pStr_CheckFile = ""
Else
pStr_CheckFile = Dir
End If
End If
End If
End If
Wend
If (pBol_FileFound = False) Then
pInt_Idx = 1
While (pInt_Idx <= pCol_SubDirs.Count)
pStr_CurrentDir = FindTheFile(pCol_SubDirs.Item(pInt_Idx), rStr_FileName)
If (Len(pStr_CurrentDir) < 1) Then
pInt_Idx = pInt_Idx + 1
Else
pInt_Idx = pCol_SubDirs.Count + 1
End If
Wend
End If
pStr_ReferMsg = pStr_CurrentDir
FindTheFile = pStr_CurrentDir
End Function
'=========================================================
Good Luck
------------
Select * from Users where Clue > 0
0 rows returned