Sub fileSearch() Dim fs As fileSearch Dim numFiles As Long Set fs = Application.fileSearch With fs .NewSearch numFiles = .Execute End With End Sub