What is an Overallocated Assignment?

T

TomG

Hi,
I'm trying to stop resources being overallocated. Using VBA, I'm trapping
the Project Save event and not allowing it to happen if a resource has become
overallocated.

What I'd really like to do, is to tell the user which projects/tasks are
causing the overallocation.

The problem is that whilst I can identify an overallocated resource
(r.overallocated), there is no corresponding overallocated assignment in the
resource's assignments collection. i.e. from the code below, I get into the
"For Each a In r.Assignments" loop, but a.Overallocated is never True.

Would be grateful for any help or comments. I think I probably don't
understand the Overallocated property when it applies to a task or an
assignment (but I can't find any detailed help on it).

Thanks,
Tom


Private Sub App_ProjectBeforeSave(ByVal pj As Project, ByVal SaveAsUi As
Boolean, Cancel As Boolean)

Dim a As Assignment
Dim r As Resource
Dim t As Task

For Each r In ActiveProject.Resources
If r.Overallocated = True Then
For Each a In r.Assignments
If a.Overallocated = True Then
MsgBox "Overallocated Assignment!!"
End If
Next a
End If
Next r
 
J

Jan De Messemaeker

Hi Tom,

Isn't the problem that the resource is overallocated because of the
simultaneity of several assignments - which in their own right are not
overallocated?
 
T

TomG

Jan,
Thanks for your quick reply. I think you are correct. This leads to two more
quick questions:

(1) under what circumstances would assignment.Overallocated = True

(2) is there any way in VBA of easily finding out which tasks are involved
in a resource's overallocation?

Your help is much appreciated!

Tom
 
J

Jan De Messemaeker

Hi Tom,

1. An assignment is overallocated as oon as at least during 1 minute, the
amount of work planned exceeds the capacity (max.units) of the resource
performing the assignment.

2. Easily, no, absolutely not.
You will have to loop through the timescaled values of the resource, then
when they exceed capacity lookup which assignments show any work during that
period and store that information somewhere..

HTH
 
T

TomG

That's great. Thanks Jan.

Jan De Messemaeker said:
Hi Tom,

1. An assignment is overallocated as oon as at least during 1 minute, the
amount of work planned exceeds the capacity (max.units) of the resource
performing the assignment.

2. Easily, no, absolutely not.
You will have to loop through the timescaled values of the resource, then
when they exceed capacity lookup which assignments show any work during that
period and store that information somewhere..

HTH

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
http://users.online.be/prom-ade/
+32-495-300 620
 
J

Jan De Messemaeker

Hi again Tom,

Sorry, I didn't have the time to look for a few possibilities I didn't
explore before.
Now I found out that this may be a shorter way:
When you activate the Task usage View, repeated use of the VBA instruction:
application.gotonextoverallocation

detects each task which causes an overallocation for (one of) the
overallocated resource(s).

Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top