Hi all,
I am using the filesearch option to find and then open a series of Excel documents.
My code is:
Set fs = Application.FileSearch
With fs
.LookIn = "C:\Mike"
.FileName = Not "*mo*"
.FileType = msoFileTypeExcelWorkbooks
If .Execute > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Workbooks.Open .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
Now, I want to find and open all the files that have a name that isn't "*Mo*". Any Ideas?
I am using the filesearch option to find and then open a series of Excel documents.
My code is:
Set fs = Application.FileSearch
With fs
.LookIn = "C:\Mike"
.FileName = Not "*mo*"
.FileType = msoFileTypeExcelWorkbooks
If .Execute > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Workbooks.Open .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
Now, I want to find and open all the files that have a name that isn't "*Mo*". Any Ideas?