I recently upgraded OS and Office to XP and I am having great difficulty getting old Excel macros to work. One especially troubling one is the filesearch().
I have a directory with at least one *.zip file but I cannot get it to enumerate with the following code:
Dim fnmes(10)
Set fs = Application.FileSearch
With fs
.NewSearch
.FileType = msoFileTypeAllFiles
.LookIn = "C:\Test\"
.SearchSubFolders = False
.Filename = "*.*"
.Execute
End With
fc = fs.FoundFiles.Count
For x = 1 To fc
MsgBox fs.FoundFiles(x)
Next
It will return all files in the directory EXCEPT the zip files. It's like they don't exist (but they do)!
It used to work fine. Any suggestions? Thanks!
I have a directory with at least one *.zip file but I cannot get it to enumerate with the following code:
Dim fnmes(10)
Set fs = Application.FileSearch
With fs
.NewSearch
.FileType = msoFileTypeAllFiles
.LookIn = "C:\Test\"
.SearchSubFolders = False
.Filename = "*.*"
.Execute
End With
fc = fs.FoundFiles.Count
For x = 1 To fc
MsgBox fs.FoundFiles(x)
Next
It will return all files in the directory EXCEPT the zip files. It's like they don't exist (but they do)!
It used to work fine. Any suggestions? Thanks!