Application.FileSearch doesnt work right

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

There is nothing wrong with the following piece of code, it can be executed
in many PCs I tested it w/office 2003 and xp:

With Application.FileSearch
.LookIn = ThisWorkbook.Path
.FileType = msoFileTypeAllFiles
.SearchSubFolders = False
.Execute
->> do stuff with found files
end with

I just formatted my laptop, installed fresh copy of Office 2003 (the same I
had before), and for some reason at the line .Execute, it stalls for 1 or 2
minutes, and it doesnt find any files, when there ARE some.

I tried to see which .dll refers to Application.FileSearch, to update it,
but it seems to be in EXCEL.EXE.

I have used this code for many applilcations for some time and never saw
this bug, what could it be?

Thanks
Fernando
 
Fernando,
Many report flakey behaviour of .FileSearch and it has been removed from
XL2007

Just use VBA's own Dir( ).

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top