Compartir a través de


Resource.MaxUnits Property

Project Developer Reference

Sets or returns the maximum number of units of a resource, as specified in the current row of the Resource Availability grid for the resource. The current row is that where the date range between the Available From and Available To columns includes the current date. Read/write Variant.

Syntax

expression.MaxUnits

expression   A variable that represents a Resource object.

Remarks

The MaxUnits property does not return any meaningful information for material resources. Setting a value returns a trappable error (error code 1101) when applied to material resources.

Example
The following example sets the maximum units of each resource in the active project to a number specified by the user.

Visual Basic for Applications
  Sub SetDefaultMaxUnits()
Dim Entry As String     ' Maximum units specified by user
Dim R As Resource       ' Resource object used in loop

Entry = InputBox$("Enter the default maximum units for each resource.")

If IsNumeric(Entry) Then
    For Each R In ActiveProject.Resources
        R.<strong class="bterm">MaxUnits</strong> = Entry
    Next R
Else
    MsgBox ("You didn't enter a numeric value.")
End If

End Sub

See Also