Determine if resource is available for the full duration of a task(VBA MSP2003 not server)

T

Thomas V

Hi,

I need to programmatically determine if a resource is 100% available
for the duration of a task.

The following code will do the job using TimeScaleData but it's far
from optimal since the timescale is pjTimescaleMinutes which gets
pretty intense to run on long tasks.

Is there a more optimal way to determine this?

Private Function isResourceAvailable(tskT As Task, resR As Resource)
As Boolean
Dim rTSV As TimeScaleValues, i As Long
isResourceAvailable = True

Set rTSV = resR.TimeScaleData(tskT.Start, tskT.Finish,
pjResourceTimescaledRemainingAvailability, pjTimescaleMinutes)

For i = 1 To rTSV.Count
If rTSV.Item(i).value <> 1 And rTSV.Item(i).value <> "" Then
isResourceAvailable = False
Exit For
End If
Next i
End Function

Thanks!
 
R

Rod Gill

Hi,

I wouldn't try to time manage the resources. I believe that weekly is the
smallest timescale you need to worry about in project management except for
cut-over tasks and shutdowns.

If you need 30h from a resource for a week, simply read availability for the
week. If availability is 30 or over, rely on the Resource and their team
lead to fit the 30h in!

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 
T

Thomas V

Thanks for your insight Rod. I see your point.
I guess that using a week as timescale and checking availability at
that level would do just as well.

- Thomas
 

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