I am using the code below to find text files for importing in to Excel.
I am getting the an error message "Run-Time error '5': Invalid
procedure call or argument." The strange part is that I copied this
code exactly from another workbook and it work beautifully. Any idea
why it would work on one workbook and not another? It bombs out on the
file .FileType = msoFileTypeAllFiles.

Sheets("Dialog Output").Select
Range("g3").Select
act = Selection.Value
Range("g4").Select
mgr = Selection.Value
Range("g5").Select
stdt = Selection.Value
Range("g6").Select
enddt = Selection.Value
With Application.FileSearch
.NewSearch
.LookIn = "F:\MAIN\Michael\EXCEL\Trading\Blk Files\"
.FileType = msoFileTypeAllFiles
.SearchSubFolders = False
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) Like "*" + act + "*.txt" And .FoundFiles(i)
Like "*" + mgr + "*.txt" Then
If FileDateTime(.FoundFiles(i)) >= stdt And
FileDateTime(.FoundFiles(i)) <= enddt Then

Thanks - Michael