Application.ConsolidateProjects method (Project)

Displays the data from one or more projects in a single window.

Syntax

expression. ConsolidateProjects( _Filenames_, _NewWindow_, _AttachToSources_, _PoolResources_, _HideSubtasks_, _openPool_, _UserID_, _Password_ )

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Filenames Optional String One or more file names of projects to consolidate.
NewWindow Optional Boolean True if projects are inserted (consolidated) into a new project. False if projects are inserted into the active project at the selection point. The default value is False.
AttachToSources Optional Boolean True if changes in the consolidated project affect source projects. The default value is True.
PoolResources Optional Variant The PoolResources argument is ignored in Project. It's retained so that existing macros that use this argument don't cause errors.
HideSubtasks Optional Boolean True if the subtasks of the projects specified with Filenames are hidden. The default value is True.
openPool Optional Long The action to take when opening a resource pool or sharer file. When opening a master project, the value for this argument is also applied to the subprojects. Can be one of the following PjPoolOpen constants. The default value is pjPromptPool.
UserID Optional Variant A user ID to use when accessing a project in a database. If Filenames does not refer to a database, UserID is ignored.
Password Optional String A password to use when opening password-protected project files. If Password is incorrect or omitted and a file requires a password, the user is prompted for the password.

Return value

Boolean

Remarks

To specify that a consolidated project should be inserted as read-only, append "(R/O)" to the file name in the Filenames argument.

Example

The following example creates a consolidated project, prints a report, and closes the consolidated project without saving it.

Sub ConsolidatedReport() 
    ConsolidateProjects Filenames:="Project1.mpp" & ListSeparator & "Project2.mpp", NewWindow:=True 
    ReportPrint Name:="Critical Tasks" 
    FileClose Save:=pjDoNotSave 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.