P
Paul Ho
Hello,
I have *.cab file c:\temp. But why I couldn't search *.cab with below code
?It shown me all files but excluded *.cab? Please help, thanks.
With Application.FileSearch
.LookIn = "C:\temp"
.Filename = "*.*"
.SearchSubFolders = True
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
MsgBox "Number of *.txt was found: " & .FoundFiles.Count
Debug.Print "---Number of file found : " & .FoundFiles.Count
For i = 1 To .FoundFiles.Count
Debug.Print .FoundFiles(i)
Next i
Else 'exit program if no file was found
MsgBox "There were no files was found! Please check"
End
End If
End With
I have *.cab file c:\temp. But why I couldn't search *.cab with below code
?It shown me all files but excluded *.cab? Please help, thanks.
With Application.FileSearch
.LookIn = "C:\temp"
.Filename = "*.*"
.SearchSubFolders = True
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
MsgBox "Number of *.txt was found: " & .FoundFiles.Count
Debug.Print "---Number of file found : " & .FoundFiles.Count
For i = 1 To .FoundFiles.Count
Debug.Print .FoundFiles(i)
Next i
Else 'exit program if no file was found
MsgBox "There were no files was found! Please check"
End
End If
End With