Project) (Assignment.StartVariance 属性
获取比较基准开始日期和工作分配的开始日期之间的差异 (以分钟为单位)。 只读变体。
语法
expression。 StartVariance
表达 一个代表 Assignment 对象的变量。
示例
以下示例活动项目中滞后开始的任务的数目。
Sub CountLateAssignments()
Dim a As Assignment
Dim t As Task
Dim numLateAssignments As Long
Dim lateAssignments As String
Dim daysLate As Single
numLateAssignments = 0
' Look for late tasks in the active project.
For Each t In ActiveProject.Tasks
For Each a In t.Assignments
If a.BaselineStart < ActiveProject.CurrentDate And a.StartVariance > 0 Then
numLateAssignments = numLateAssignments + 1
daysLate = Round(a.StartVariance / 1440, 1)
lateAssignments = lateAssignments & vbCrLf & vbTab & t.Name _
& ": resource " & a.Resource.Name & ": " & daysLate & " days"
End If
Next a
Next t
MsgBox "There are " & numLateAssignments & " late assignments in this project: " & lateAssignments
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。