I'm currently trying to search directories for any file labelled "??.??.????.xls" (for mm.dd.yyyy.xls). The problem I have is that the code I'm using also matches filenames such as "my-restaurant.12.01.2006.xls". I only want to match filenames with specifically the notation I used above.
Dim Invoices As FileSearch
Set Invoices = Application.FileSearch
With Invoices
.Filename = "??.??.????.xls"
' invDir is a directory I chose earlier on
.LookIn = invDir
.SearchSubFolders = True
.MatchTextExactly = True
End With
Is there something I'm missing? I know I could do yet another check in my code elsewhere to make sure the filename's length is 14 characters, but is there a parameter I'm not considering in the FileSearch?