Application.FileSearch.Execute problem in Project VBA

T

TAT

I am running MS Project 2002 SP1 and Excel 2000. Here is
an example of part of a macro I am writing in Project.
The .Execute call causes an error dialog box saying "An
error occurred and this feature is no longer functioning
properly. Would you like to repair this feature now?"

It makes no difference whether I say Yes or No, the code
continues to execute properly. If I say Yes, it goes
through some Windows installer installation, then finishes
executing. But this will happen every single time.

The same macro, when run in Excel 2000, does not cause the
problem.

Sub TestFileSearch()
With Application.FileSearch
.LookIn = "C:\"
.SearchSubFolders = False
.FileName = "test.txt"
' Next line causes error in MSP 2002, Not in Excel 2000
If .Execute() = 1 Then
MsgBox (.FoundFiles(1))
Else
MsgBox ("File not found!")
End If
End With
End Sub
 

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

Top