title | ms.prod | api_name | ms.assetid | ms.date | |
---|---|---|---|---|---|
Task.StartVariance Property (Project) |
project-server |
|
8ec7f5c9-62c4-36fd-d245-4a2bf21fd7bd |
06/08/2017 |
Gets the variance (in minutes) between the baseline start date and the start date of the task. Read-only Variant.
expression. StartVariance
expression A variable that represents a Task object.
The following example displays the number of tasks and task names in the active project that have started late.
Sub CountLateTasks()
Dim t As Task
Dim numLateTasks As Long
Dim lateTasks As String
Dim daysLate As Single
numLateTasks = 0
' Look for late tasks in the active project.
For Each t In ActiveProject.Tasks
If t.BaselineStart < ActiveProject.CurrentDate And t.StartVariance > 0 Then
numLateTasks = numLateTasks + 1
daysLate = Round(t.StartVariance / 1440, 1)
lateTasks = lateTasks &; vbCrLf &; vbTab &; t.Name _
&; ": " &; daysLate &; " days"
End If
Next t
MsgBox "There are " &; numLateTasks &; " late tasks in this project: " &; lateTasks
End Sub