Results 1 to 15 of 15

Thread: VBA to use all projects in folder as subprojects

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,709
    Location
    C&P From the help file
    ConsolidateProjects Method


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

    Syntax:
    expression.ConsolidateProjects(Filenames, NewWindow, AttachToSources, PoolResources, HideSubtasks, openPool, UserID, Password)


    • expression Optional. An expression that returns an Application object.
    • 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 Due to changes in the object model of Microsoft Project, this argument is ignored. It is retained so that existing macros which make use of this argument do not 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: pjDoNotOpenPool, pjPoolAndSharers, pjPoolReadOnly, pjPoolReadWrite, or pjPromptPool. The default value is pjPromptPool.
    • UserID Optional String. 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.


    Remarks
    To specify that a consolidated project should be inserted as read-only, type (R/O) at the end of the file name in Filenames.

    If the ConsolidateProjects method is used without specifying any arguments, the Insert Project dialog box appears.
    If a Parameter is not specified, the Default value is used.

    MasterProject.ConsolidateProjects(Filenames:=projFile)
    That is equivalent to
    MasterProject.ConsolidateProjects(Filenames:=projFile, NewWindow:=False, _
     AttachToSources:=True, PoolResources:=Null, HideSubtasks:=True, _
    openPool:=pjPromptPool, UserID:="", Password:="")
    Last edited by SamT; 02-05-2016 at 10:48 AM.
    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •