Assignment.StartVariance 屬性 (Project)
[比較基準開始日期和工作分派的開始日期之間取得的變異數 (以分鐘為單位)。 唯讀 Variant 。
語法
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 支援與意見反應。