Closing subprojects without Save prompts

T

tbone

I believe I've determined that Project closes a project file when I
close its window with Windows("name.mpp").Close - UNLESS that file is
a subproject linked to a loaded Master project. In the latter case,
the window is closed but the subproject file remains loaded. This was
the cause of my earlier perceived anomaly with Projects.Count being
greater than the number of visible projects loaded. Even if I close
the subproject window from the UI with the close button, the same
behavior is exhibited.

I wrote a routine to update custom fields of the Master project file's
subproject tasks from the corresponding fields of the Project Summary
Task in each subproject. This requires loading the referenced
subproject files (if they're not already loaded) to obtain that
information. My code currently closes the window for each subproject
that was not already explicitly loaded by the user.

The problem here is that when a user wants to close the Master
project, Save prompts appear for all the subproject files, not just
the ones they loaded. I also tried loading the subproject files
read-only, but the prompt still appears. I don't want Save prompts
shown for any files that the user didn't explicitly load. The Project
object has no Close method.

How can I address this?

thanks
tbone
 
J

Jack Dahlgren MVP

I think that project will "load" the subprojects in a master file if you
expand them. It works this way to allow you to open master projects more
quickly. The subprojects are only loaded when they are needed - so try
throwing in:

OutlineShowAllTasks

and see if that helps you.

-Jack Dahlgren
 

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