none
How to determine if an external task is a summary task? RRS feed

  • Question

  • Is there any way to determine via VBA if a linked external task is a summary task, e.g., to check for links attached to summary tasks, without having to open the external project?

    In the GUI, the task summary and rollup fields (when displayed in a column) for an externally linked task that is a summary task or rollup task in its own project indicate "no".  VBA tests on these external task fields in the referencing project also do not indicate that the external task is a summary or rollup.

    I guess it's possible that I haven't set some setting or other to get this information to come over.

    As an aside, is there a list somewhere of what task fields are actually copied over into a referencing project when an external task is linked, i.e., the name and some other fields come over, but the summary and rollup fields don't appear to come over.

    Thanks!

    Thursday, April 4, 2013 3:28 PM

All replies

  • linearprism,

    Yes, but you will need to do it indirectly. First, create a master with each project inserted as a subproject. At the master level, display the Predecessors and Successors fields. Apply the built-in summary task filter. If there is an external link associated with any summary task it will show a path of C:\.... in either the Predecessors or Successors fields.

    Now, in VBA you can run through all the tasks in the master and select out those that have the type of link you are seeking. The following macro should give you a starting point. You might want to enhance it by listing the subproject name and task ID in the msgbox.

             

    Sub FindExtSumLnks()
    Dim sp As Subproject
    Dim t As Task
    For Each sp In ActiveProject.Subprojects
        For Each t In sp.SourceProject.Tasks
            If t.Summary Then
                If t.Predecessors <> "" Or t.Successors <> "" Then
                MsgBox "Oops! Somebody put links on summary lines", vbInformation
                End If
            End If
        Next t
    Next sp

    End Sub

    Hope this helps.

    John

    Thursday, April 4, 2013 8:53 PM
  • Hi John,

    Thanks for the reply and the approach, but it looks like you're confirming that you don't think I can't do this without querying the external task's properties in what amounts to its own "context", e.g., in this case a subproject of a master project.  I think I can do basically the same thing by iterating through the list of the individual project files.  I was hoping there was some way to detect the summary property without having to visit the external task's file either directly or in a temporary master, but maybe not.  Seems like, given the issues with linking to summary tasks, it would be a useful bit of information to have in the external task's "avatar" in the dependent project.

    Thanks again,

    Bill

    Thursday, April 4, 2013 9:43 PM
  • Bill,

    You're welcome and thanks for the feedback. Yes, the only way to get the information you want is to query the task object in the file where it resides. Using a master allows you to do that without actually opening each project however they will be open in the background but not visible. This could be an issue if you are planning on doing this "link audit" while users are attempting to edit their files, you may lock them out for write access.

    Also I didn't answer the last question in your original post. None of the external file information "comes over" to the active project. All you see is a visual representation through a pointer to the external file - just enough data to show the basic parameters of the external task.

    John

    Friday, April 5, 2013 3:27 PM