TaskDependency.Lag property (Project)

The duration of lag time between linked tasks. Read/write Variant.

Syntax

expression. Lag

expression A variable that represents a TaskDependency object.

Remarks

To specify lead time between tasks, use a negative value. String values default to days unless otherwise specified. Non-string values are interpreted as minutes.

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.