Task.PreleveledFinish Property

Project Developer Reference

Returns the finish date of a task before leveling occurred. Read-only Variant.



expression   A variable that represents a Task object.

The following example calculates the difference, if any, between the projected finish date and the projected finish date before the task was leveled for each task in the project, and then displays those that changed.

Visual Basic for Applications
  Sub DateDifferences()
    Dim T As Task, Results As String
    For Each T In ActiveProject.Tasks
        If Not (T Is Nothing) Then
            ' Tasks that have never been leveled return "NA"
            If T.PreleveledFinish <> "NA" And T.Finish <> T.PreleveledFinish Then
                Results = Results & T.Name & ": " & _
                    DateDiff("d", T.PreleveledFinish, T.Finish) & _
                        " days" & vbCrLf
            End If
        End If
    Next T
    If Results <> "" Then MsgBox Results
End Sub

See Also