Differentiating between same resource types?

M

Matt Steele

We are building an tool to extract some resource data into Excel. We have a
few flavors of "material" resources and would like to pull each flavor into a
separate column in Excel.

For instance I have a material resource named "ODC $" and another materieral
resource named "material $". Pulling "remaining cost" just gives the combined
total.

How do I pull the two material resources separately? What are we looking for
in the field names or rather what should we be fishing for using VBA?

Thank you!
Matt
 
J

John

Matt Steele said:
We are building an tool to extract some resource data into Excel. We have a
few flavors of "material" resources and would like to pull each flavor into a
separate column in Excel.

For instance I have a material resource named "ODC $" and another materieral
resource named "material $". Pulling "remaining cost" just gives the combined
total.

How do I pull the two material resources separately? What are we looking for
in the field names or rather what should we be fishing for using VBA?

Thank you!
Matt

Matt,
If more than one resource is assigned to a given task, loop through all
assignments for that task and then read the ResourceName property for
each assignment. The following basic code structure should get you
started.

Sub Ass_Names()
Dim t As Task
Dim a As Assignment
For Each t In activeproject.Tasks
If Not t Is Nothing Then
For Each a In t.Assignments
ResNam = a.ResourceName
[more of your code here]
Next a
End If
Next t
End Sub

John
Project MVP
 
J

Jan De Messemaeker

Hi,

Supposde teh tasks is called Mytsk
for each Massmt in mytsk.assignments
Massmnt has properties allowing to identify resource types
And it has the individual usages and costs.
HTH

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 

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