Filesearch error in Excel 2007

  • Thread starter Thread starter Libby
  • Start date Start date
L

Libby

Hi

I have a sub that add files in a folder to a listbox. It worked fine in
Excel 2003, but now in Excel 2007 it doesn't and I get an error.

the code is below

Sub Fill_Listbox
strDir = path of folder
ChrDir strDir
With Application.Filesearch
.NewSearch
.LookIn = strDir
.SearchSubFolders = False
.FileType = msoFileTypeAllFiles
If .Excecute() > 0 Then
For i = 1 to .FoundFiles.Count
'Add file name to listbox
Next i
end if
End with

I've stepped though and the error occurs at the With Application.FileSearch
part.

The error is Run-time error 445. Object doesn't support this action.


Can anyone tell my why this doesn't work in Excel 2007 and if possible how
to achieve the same results using Excel 2007?

Many thanks in advance.
 
Thanks again.

Another thing not supported by the new Excel. So far I'm struggling to see
any advantages.
 
Back
Top