This code works in Excel 2003 but when I run it in 2007 it hangs on "Set FileS..." The error says wrong method.
Any help would be greatly appreciated!
'020 Read & build list of all *XLS files including subfolders (optionally)
Dim FileS As FileSearch
Dim F As Variant
Dim x As Integer
Set FileS = Application.FileSearch
With FileS
.NewSearch
.Filename = "*.xls" 'hardwired to look for only excel
.LookIn = Cells(30, 4)
.SearchSubFolders = False
.Execute
End With
C13 = 1
For Each F In Application.FileSearch.FoundFiles
Cells(C13, 25) = F: C13 = C13 + 1
Next F
Bookmarks