Project) (Project.LevelToDate 属性
获取或设置在其中调配过度分配的资源范围的结束日期。 默认值为项目的结束日期或最近输入的日期值。 读/写 Variant。
语法
expression。 LevelToDate
表达 一个代表 Project 对象的变量。
备注
您还可以在 资源调配对话框中设置 LevelToDate 属性。 若要访问该设置,请单击功能区中,在 资源选项卡上 调配选项然后单击 级别选项并设置 为日期。
示例
如果当前资源调配日期范围始于项目的开始日期,终于项目的完成日期,则下例让用户更改进行资源调配的日期范围。
Sub ChangeLevelingDates()
Dim Response As Long
Dim NewFrom As Variant, NewTo As Variant
With ActiveProject
If Application.DateDifference(.ProjectSummaryTask.Start, .LevelFromDate) = 0 Then
Response = MsgBox("Overallocated resources are leveled from " & _
"the project start date. Should that be changed?", vbYesNo)
If Response = vbYes Then
NewFrom = InputBox("Date to level from: ")
.LevelFromDate = NewFrom
Else
MsgBox "Resources remain leveled from the project start date."
End If
End If
If Application.DateDifference(.ProjectSummaryTask.Finish, .LevelToDate) = 0 Then
Response = MsgBox("Overallocated resources are leveled to " & _
"the project finish date. Should that be changed?", vbYesNo)
If Response = vbYes Then
NewTo = InputBox("Date to level to: ")
.LevelToDate = NewTo
Else
MsgBox "Resources remain leveled to the project finish date."
End If
End If
End With
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。