TaskDependency.LagType property (Project)
Gets the unit of lag time between linked tasks. Read-only PjFormatUnit.
Syntax
expression. LagType
expression A variable that represents a TaskDependency object.
Remarks
In the Lag property, string values default to days unless otherwise specified. Non-string values are interpreted as minutes. To specify lead time between tasks, use a negative value for the Lag property.
Example
To use the SetLagWeeks macro, create two tasks, where Task 2 is linked to Task 1. When you run the macro, the Immediate window shows 4800 and 9, where the lag time is 4800 minutes and the type of lag is 9 (pjWeeks).
Sub SetLagWeeks()
Dim tsk As Task
Set tsk = ActiveProject.Tasks(2)
tsk.TaskDependencies(1).Lag = "2w"
Debug.Print tsk.TaskDependencies(1).Lag
Debug.Print tsk.TaskDependencies(1).LagType
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.