hatman
Well-known Member
- Joined
- Apr 8, 2005
- Messages
- 2,664
I am trying to retrieve a list of Tasks from an MS Project File. The nuts and bolts of the effort are pretty straightforward. I'm having problems with closing the file(s) when I'm done. Here is the important parts of my routine:
The actual source file is nothing but a reference to 25 OTHER mpp files, each of which references still other files. In Parsing the project.tasks collection, there are over 9500 tasks, as it recursively pulls tasks from each subfile in the tree. This all works flawlessly if slowly. Untill I get to Mpp.Quit. At that point, my heretofor invisible Project application becomes visible with the SaveAs user dialog displayed. This is IN SPITE of setting Mpp.DisplayAlerts = False. I also found that unlike Excel, where I can set the .Saved property to true, in Project that's a Readonly property. And while the Project menu offers the Close command for each individual project object, there is NO .Close mehod available through the Object Model interface. Anybody have any advice? I'm getting very frustrated on this one.
Code:
...
Set Mpp = New MSProject.Application
...
Mpp.FileOpenEx Name:="G:\ACE\Lab Status Monitors\Sandbox\Template Folder\MasterC.mpp", ReadOnly:=True, openpool:=pjPoolReadOnly
...
Mpp.Quit
Set Mpp = Nothing
...
The actual source file is nothing but a reference to 25 OTHER mpp files, each of which references still other files. In Parsing the project.tasks collection, there are over 9500 tasks, as it recursively pulls tasks from each subfile in the tree. This all works flawlessly if slowly. Untill I get to Mpp.Quit. At that point, my heretofor invisible Project application becomes visible with the SaveAs user dialog displayed. This is IN SPITE of setting Mpp.DisplayAlerts = False. I also found that unlike Excel, where I can set the .Saved property to true, in Project that's a Readonly property. And while the Project menu offers the Close command for each individual project object, there is NO .Close mehod available through the Object Model interface. Anybody have any advice? I'm getting very frustrated on this one.