Table of contents
TOC
Collapse the table of content
Expand the table of content

StartDriver.Warnings Property (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Gets a combination of PjTaskWarnings values that indicate whether there are problems for a specified task. Read-only Long.

Syntax

expression. Warnings

expression An expression that returns a StartDriver object.

Remarks

If there are no warnings for a task, the value of Warnings is 0. Because the value of pjTaskWarningResourceBeyondMaxUnit is 64 and the value of pjTaskWarningResourceOverallocated is 128, if Warnings is 192, the task has both of the problems.

Note The PjTaskWarnings enumeration can be used with both the Suggestions property and the Warnings property.

Example

In the following example, if the value of the Warnings property for task 5 is 128, the message box shows The resource is overallocated.. If the value is 68, the message box shows:

  • The assignment is more than the maximum resource units available.

  • The shadow task finishes earlier because of a predecessor link.

Sub GetTaskWarnings() 

 Dim warnings As Long 

 Dim warningMsg As String 



 warnings = ActiveProject.Tasks(5).StartDriver.Warnings 



 warningMsg = CheckWarnings(warnings) 



 If Not warningMsg = "" Then MsgBox warningMsg 

End Sub 



Function CheckWarnings(warnings As Long) As String 

 Dim partial As Long 

 Dim warningResult As String 



 warningResult = "" 

 partial = warnings Xor pjTaskWarningResourceBeyondMaxUnit 

 If partial < warnings Then _ 

 warningResult = warningResult &; "The assignment is more than the maximum resource units available." &; vbCrLf 



 partial = warnings Xor pjTaskWarningResourceOverallocated 

 If partial < warnings Then _ 

 warningResult = warningResult &; "The resource is overallocated." &; vbCrLf 



 partial = warnings Xor pjTaskWarningShadowFinishesEarlierDueToLink 

 If partial < warnings Then _ 

 warningResult = warningResult &; "The shadow task finishes earlier because of a predecessor link." &; vbCrLf 



 CheckWarnings = warningResult 

End Function

See also

Concepts

StartDriver Object

© 2018 Microsoft