Activity DRAG in Microsoft Project

Activity DRAG in Microsoft Project

Activity DRAG is a helpful schedule analysis metric. While Microsoft Project doesn’t have a built-in capability to calculate Activity DRAG, it can be functionally enhanced with VBA macros and add-ons.

I have developed a macro that calculates two schedule metrics: Activity DRAG and Activity Elapse DRAG.

Elapse Activity DRAG

Elapse Activity DRAG shows absolute acceleration is based on calendar days.

Activity DRAG

Activity DRAG shows relative acceleration based on PROJECT working days.
Both perspectives are essential and complement each other.

.Example

If I am told that a 4-day activity has four days of Activity DRAG, I may logically assume that this activity fully contributes to the overall duration. However, if the units of measure are not the same, such assumption will be incorrect.

If activity duration is measured in working days, but drag is calendar days, the possible acceleration could be less than 4 days.

In this fragment, Activity B has duration = 4 days, Activity DRAG = 2 days, Elapse DRAG = 4 days. So, the possible acceleration is only half of the activity duration. 

Method of Calculation

There are two ways to calculate activity Drag: smart but complex and straight but simple.

The smart way is done via analysis of logic in the schedule. The straight way is to calculate changes in project duration by applying changes in activity duration and measuring changes in project duration.

This macro uses the second approach. The downside of this approach – is the calculation time, but it is minutes, not hours, so practically, time is not a crucial factor.
Overall calculation time depends on many factors, but the rule of thumb is “1 minute per 1,000 activities”.

This approach can be used in any scheduling tool that allows custom enhancement. For example, it can be done in Primavera EPPM, Planner Premium, Clarify, etc.

VBA Script to calculate Activity DRAG for Microsoft Project (FREE)

Here’s a free VBA macro to calculate Activity DRAG in Microsoft Project. It calculates Activity Drag and Activity Drag Elapse.  

This macro helps project managers and planners analyse Critical Path and optimise schedules to enable better decision-making and successful project delivery.

Sub MeasureActivityDRAG()

‘ This VBA script calculates the Critical Path Drag for each task
‘ Activity Drag is calculated in working days (based on the project calendar) and calendar days
‘ Copyright (c) 2024 Salute Enterprises
‘ Coded Alex Lyaschenko, PMP September 2024
‘ All rights reserved
‘ Use of this code is permitted for any educational and professional purposes. Enjoy.

Set proj = ActiveProject                                          ‘ Set reference to the active project

origProjEndDate = proj.ProjectFinish             ‘ Save the original project completion date

For Each tsk In proj.Tasks                                    ‘ Iterate through each task in the project

   ‘ Skip summary tasks, completed tasks, manual tasks and milestones

   If Not tsk.Summary And tsk.PercentComplete < 100 And tsk.Duration > 0 And Not tsk.Manual Then

   tsk.Duration1 = tsk.Duration                               ‘ Save the current duration to custom field “Duration1”

   tsk.Duration = 0                                                        ‘ Change the task duration to zero

   Application.CalculateProject                               ‘ Recalculate the project schedule

   newProjEndDate = proj.ProjectFinish             ‘ Get the new project completion date

   ‘ Calculate the difference in completion date

   ‘ In working days based on the project calendar (Activity Drag)

   dateDifference = proj.Application.dateDifference(newProjEndDate, origProjEndDate, proj.Calendar) / 480 

   ‘ In calendar days (Elapse Drag)

   durationDiff = DateDiff(“d”, newProjEndDate, origProjEndDate)

   tsk.Number1 = dateDifference                            ‘ Save the result in “Number1”  custom field

   tsk.Number2 = durationDiff                                 ‘ Save the result in “Number2”  custom field

   tsk.Duration = tsk.Duration1                                ‘ Restore the original duration from “Duration1”

   Application.CalculateProject                                ‘Recalculate the project schedule

   End If

Next tsk

Application.CalculateProject                                ‘ Recalculate the project schedule one last time

MsgBox “Activity Drag saved in ‘Number1’ field and Elapse Drag in ‘Number2’ field”

End Sub

Alex Lyaschenko

PMO | Portfolio Planning & Delivery | PMP | P3O Practitioner | AgilePM Practitioner | Six Sigma