Application.Filesearch.Execute Error

S

statman

Can anyone confirm the error I've been receiving using the following code?
Simple request to eventually allow a user to select which files/projects to
insert into an empty project. I've only included MSGBOX prompts for debugging
purposes. Popup box, following .EXECUTE command, tries to repair the feature
that is "no longer functioning".

CProj = ActiveProject.Name
Cpath = ActiveProject.Path

Cname = ""
tnum1 = 0

With Application.FileSearch
.NewSearch
.LookIn = Cpath
.SearchSubFolders = True
TargetFile = "*.mpp"
.FileName = TargetFile
MsgBox "HI"
If .Execute(SortBy:=msoSortByFileName, SortOrder:=msoSortOrderAscending)
MsgBox "Number of Files Found: " & .FoundFiles.Count
End If
End With
 
R

Rod Gill

This works for me in Project 2003. I've had problems with earlier versions
of Project getting this to work. So, your installation may have a
corruption? What version of Project are you using?
 
S

statman

using Project 2003 (standard), but with Office XP (not 2003). Could it be a
VBA issue (currently using VBA 6.3)?
 
R

Rod Gill

Hi,

The FileSearch object comes from the Office Library and I have Office 2003.
I suspect that the problem is in there somewhere. You need to find someone
else with Project 2003 and Office XP to test the code.
 

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

Similar Threads


Top