A family of Microsoft relational database management systems designed for ease of use.
Nathalie,
There is nothing inherently wrong with your syntax
ActiveProject.Tasks(1).Assignments.Add ResourceID:=9, Units:=0.6
However, if you attempt to add that same resource as another assignment to the same task, you will get a runtime error, because that resource is already assigned to the task.
I'm just guessing here but what I think you may be trying to do is to change the resource assignment, not add the assignment. If you want to change an existing assignment, you first must delete the assignment and then use the add method. Or, if you just want to change the units assignment of an existing assignment, the following syntax will work.
ActiveProject.Tasks(1).Assignments(1).Units=0.6
Note: you would need a loop of all that tasks assignments to determine which assignment index to update.
Hope this helps.
John