Matt Steele
06-25-2007, 04:52 PM
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
In article <888B078B-9001-43A5-A617-923BE1764F82@microsoft.com>,
Matt Steele <MattSteele@discussions.microsoft.com> wrote:
> 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
Jan De Messemaeker
06-25-2007, 07:21 PM
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
"Matt Steele" <MattSteele@discussions.microsoft.com> wrote in message
news:888B078B-9001-43A5-A617-923BE1764F82@microsoft.com...
> 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
>
>