G
Guest
Hi all,
I copied the following code elsewhere, so I know it must work:
strFiles = ""
With Application.FileSearch
.NewSearch
.LookIn = strDrive
.SearchSubFolders = True
.FileName = strFilename
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then
For Each varItm In .FoundFiles
strTmp = fGetFileName(varItm)
If strFilename = strTmp Then
fReturnFilePath = varItm
Exit Function
End If
Next varItm
End If
Anyway, my issue is that when the ".Execute" line is encountered, it appears
as if the method isn't even being attempted. The program appears to run for
about 2 seconds, then goes right to the "End If" line associated with the
".Execute" line. It's as if the condition is automatically assigned a False
value before the method is allowed run.
I do have the correct references implemented. Am I missing something simple?
Thanks, as always.
I copied the following code elsewhere, so I know it must work:
strFiles = ""
With Application.FileSearch
.NewSearch
.LookIn = strDrive
.SearchSubFolders = True
.FileName = strFilename
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then
For Each varItm In .FoundFiles
strTmp = fGetFileName(varItm)
If strFilename = strTmp Then
fReturnFilePath = varItm
Exit Function
End If
Next varItm
End If
Anyway, my issue is that when the ".Execute" line is encountered, it appears
as if the method isn't even being attempted. The program appears to run for
about 2 seconds, then goes right to the "End If" line associated with the
".Execute" line. It's as if the condition is automatically assigned a False
value before the method is allowed run.
I do have the correct references implemented. Am I missing something simple?
Thanks, as always.