Getting WBS from resource assignment

L

Lucas Soler

I'm retrieving the data as if I were in the Resource Usage view. How do I
pull the WBS for the assigned tasks?

Example:
RESOURCE WBS ACTUAL WORK
John 1.1.1 10

Actual VBA I'm using:
For Each R In ActiveProject.Resources

xlR.Range("A1:F1") = Array(R.ID, R.Name, " ", R.ActualWork,
R.RemainingWork, R.PercentWorkComplete)
xlR.Range("B1").Font.Bold = True
xlR.Range("A1").HorizontalAlignment = xlCenter

Set xlR = xlR.Offset(1, 0) 'point to next row in Excel
Counter = Counter + 1

For Each A In R.Assignments
xlR.Range("B1:F1") = Array(A.TaskName, " ", A.ActualWork / 60, _
A.RemainingWork / 60, A.PercentWorkComplete)
xlR.Range("B1").IndentLevel = 3

Set xlR = xlR.Offset(1, 0)
Counter = Counter + 1

Next A

Next R
 
R

Rod Gill

Hi,

A property of each assignment is the task id. Use this on
ActiveProejct.Tasks(AssignmentObject.ID) to get the wbs
 

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