Task Paths in Project 2013

Here’s probably one of the most interesting new features (well, other than reporting) added to the new Microsoft Project desktop client – the Task Path feature.  This feature allows you to easily review a schedule to assess the impact of a single task.


First off, I point out that fellow MVP Nenad Trajkovski has already posted on this topic.  I wanted to add to his post, and perhaps provide some additional information on how to consume this new feature in the updated Project VBA object model.

In the screenshot above, you see that I have selected a single task.  Each of the driving predecessors of the task are highlighted in orange.  In turn, the driven successors of the task are highlighted in purple.

This is all controlled through the Task Path interface, now found on the Gantt Chart Format tab.


Opening that dropdown, you see the options for the task path display.  Note that these options are not mutually exclusive, i.e. I can actually select all of the options to add informational depth to my Gantt Chart display.


As always, just mouse over the bar in the Gantt Chart to see what the color represents – or doubleclick on the Gantt Chart to see the legend.


So that’s great, but what about if I want to filter on only those tasks that are predecessors and successors?  There’s no field affiliated with that setting, so how can I determine which tasks are relevant?

Enter VBA.  The new setting may be consumed via the VBA object model using:

  • Task.PathDrivenSuccessor
  • Task.PathDrivingPredecessor
  • Task.PathPredecessor
  • Task.PathSuccessor

For example, the following VBA code will label each task within the schedule as a Predecessor or Successor in the Text1 field, and then filter the view on only those tasks which have been flagged.

Sub DefinePath()

    Dim T As Task
    Dim I As Integer

    'Clear the existing filter

    'Capture the selected task
    I = Application.ActiveCell.Task.ID

    'Flag the Predecessors and Successors
    For Each T In ActiveProject.Tasks
        T.Text1 = ""
        If T.ID = I Then
            T.Text1 = "Selected Task"
        End If
        If T.PathPredecessor = True Then
            T.Text1 = "Predecessor"
        End If
        If T.PathSuccessor = True Then
            T.Text1 = "Successor"
        End If
    Next T

    'Apply a filter on the flagged tasks
    SetAutoFilter FieldName:="Text1", FilterType:=pjAutoFilterIn, _
    Criteria1:="Predecessor" & Chr$(9) & "Successor" & Chr$(9) & "Selected Task"

End Sub

Here’s what the results look like…


Task Paths in Project 2013

11 thoughts on “Task Paths in Project 2013

  1. mrbiz404@verizon.net says:

    Hi Andrew,

    I love this approach…it will be very helpful in managing projects. I’d like to incorporate, but have run into problems implementing. When I run this macro, I the only task that is labeled is the one selected when I run the macro. None of the predecessors are defined in the “Text1” column. Any thoughts on how to correct?

  2. Albroswift says:

    Hello, Andrew
    Came across this macro, I know its an old thread but maybe you are still following
    When I run the macro, I do not get the successors
    “Selected task”
    Blank (Expected “Successor” here)
    Blank (Expected “Successor” here)
    It is like the ActiveTask does not contain successor information (Also tried DrivingPredecessor, DrivenSuccessor, same results)
    Running 2013 STD, is there a setting controlling what relationships are stored in ActiveTask?

  3. Albroswift says:

    Hello, Andrew
    Figured out what I was doing wrong, Macro has been working well until a few days ago, now get an error after the macro runs through all the tasks and before it filters out the blank lines
    T.Text1 = “” Object variable not set (Error 91).
    I downloaded the original code a second time, no modifications, and same error. Any idea what may have changed in the environment that could cause this?

  4. Chuck Hamdan says:

    Hi, I know this is old but I tried the macro and I am getting a weird error such as:
    “Sub or Function not defined” and the highlighted command is on “setAutoFilter” in
    ” ‘Apply a filter on the flagged tasks
    SetAutoFilter FieldName:=”Text1″, FilterType:=pjAutoFilterIn, _
    Criteria1:=”Predecessor” & Chr$(9) & “Successor” & Chr$(9) & “Selected Task”


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s