PRJ2000: Units Not Set When You Assign Material Resource Using Add Method (242722)



The information in this article applies to:

  • Microsoft Project 2000

This article was previously published under Q242722

SYMPTOMS

In Microsoft Project, when you use the Add method in a Microsoft Visual Basic for Applications macro to assign a material resource to a task, and you set the units assigned to the material resource, the Units value is not set and remains the default value of 1.

CAUSE

This behavior occurs when you use the Add method to assign a material resource to a task and you include the Units argument to set the assignment units, for example:
ActiveProject.Tasks(1).Assignments.Add ResourceID:=1, Units:=200
				

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. To work around this problem, set the value of units for the material resource after you assign the resource.

For example, you can use the following lines of code:
ActiveProject.Tasks(1).Assignments.Add ResourceID:=1
ActiveProject.Tasks(1).Assignments(1).Units = 200
				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Modification Type:MajorLast Reviewed:6/23/2005
Keywords:kbbug kbpending KB242722