OverAllocatedAssignments 对象 (Project)
代表资源过度分配的 Assignment 对象的集合。
备注
使用 Item 属性来获取 OverAllocatedAssignments 集合中的单个 工作分配 对象。
示例
下面的示例查找工作分配过度分配资源所在。 OverPeak 参数为 False ,过度分配时不大于可用资源的最大时间 (100%)。 如果将 overPeak 设置为 True ,则查找过度分配的工作分配超过可用,如 150%的资源的最大时间。
Sub FindOverallocatedAssignments()
Dim t As Task
Dim a As Assignment
Dim overAlloc As OverAllocatedAssignments
Dim numOver As Long
Dim overPeak As Boolean
overPeak = False
For Each t In ActiveProject.Tasks
If t.Overallocated Then
Set overAlloc = t.StartDriver.OverAllocatedAssignments(overPeak)
numOver = overAlloc.Count
totalNumOver = overAlloc.TotalDetectedCount
For Each a In overAlloc
Debug.Print "Resource: " & a.Resource.Name & " is overallocated on task: " & t.Name
Debug.Print vbTab & "Number of overallocated assignments: " & numOver
Next a
End If
Next t
End Sub
属性
名称 |
---|
Application |
Count |
项目 |
Parent |
TotalDetectedCount |
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。