N
NIC
Has anyone ran into this before...
I can't seam to get Filesearch to find any files
The below code consistantly returns .Execute = 0 (no files
found)
Any ideas or help is greately appreciated
Sub GetFileList()
Dim strDirName As String: strDirName = CurDir()
Dim strPrompt As String: strPrompt = strDirName & Chr(13)
Dim i As Long
With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents"
.SearchSubFolders = False
.FileName = "*.*"
.Execute
If .FoundFiles.Count > 0 Then
For i = 1 To .FoundFiles.Count
strPrompt = strPrompt & .FoundFiles(i) & Chr(13)
Next i
Else
strPrompt = strPrompt & "No files found."
End If
MsgBox strPrompt
End With
End Sub
I can't seam to get Filesearch to find any files
The below code consistantly returns .Execute = 0 (no files
found)
Any ideas or help is greately appreciated
Sub GetFileList()
Dim strDirName As String: strDirName = CurDir()
Dim strPrompt As String: strPrompt = strDirName & Chr(13)
Dim i As Long
With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents"
.SearchSubFolders = False
.FileName = "*.*"
.Execute
If .FoundFiles.Count > 0 Then
For i = 1 To .FoundFiles.Count
strPrompt = strPrompt & .FoundFiles(i) & Chr(13)
Next i
Else
strPrompt = strPrompt & "No files found."
End If
MsgBox strPrompt
End With
End Sub