Application.FileSearch-Problem
18.03.2003 15:50:34
Thomas G.
mit folgendem Makro liste ich Dateien eines Verzeichnisses auf. Unter Excel 2000 klappt es. Bei Excel 97 erhalte ich d. Fehlermeldung "Fehler beim Kompilieren:Projekt oder Bibliothek nicht auffindbar." Welcher Verweis ist zuständig?
Gruß Thomas
Sub List_Files()
Set fse1 = Application.FileSearch
With fse1
.NewSearch
.FileType = msoFileTypeAllFiles
.LookIn = "C:\test"
.Filename = "*.doc"
.SearchSubFolders = True
If .Execute(SortBy:=msoSortByLastModified, SortOrder:=msoSortOrderDescending) > 0 Then
For x = 1 To .FoundFiles.Count
y = x + 1
Cells(y, 1) = .FoundFiles(x)
Next x
Else
MsgBox "There were no files found."
End If
End With
End Sub