S
sdf
I am using the code listed belwo to bring back Timescaled data into excel. I
did a little sanity chack the other day and noticed that it always returns
the heading for the first month, but does do bring data back for that month
even though data exists in project.
Could someone tell me if I'm missing soemthing, bad variable name or counter
.. . . .etc. cause I can't see it.
Jeff
For Each Tsv In ActiveProject.ProjectSummaryTask.TimeScaleData( _
StartDate:=ActiveProject.ProjectStart, _
EndDate:=ActiveProject.ProjectFinish, _
Type:=pjAssignmentTimescaledWork, _
timescaleunit:=pjTimescaleMonths, _
Count:=1)
xlRng = Tsv.StartDate
Set xlRng = xlRng.Offset(0, 1)
colctr = colctr + 1
Next
Set xlRng = xlRng.Offset(1, -colctr)
'Print Resource Group
For Each Group In ActiveProject.ResourceGroup
xlRng = Project.Group.Name
Set xlRng = xlRng.Offset(0, 1)
'Print Resource; Name
For Each res In Proj.Resources
If Not (res Is Nothing) Then
xlRng = res.Name
Set xlRng = xlRng.Offset(0, 1)
'Print assignments
For Each tsk In ActiveProject.Tasks
If Not (tsk Is Nothing) Then
For Each asn In tsk.Assignments
If res.Name = asn.ResourceName Then
xlRng = tsk.Name
Set xlRng = xlRng.Offset(0, 1)
colctr = 1
For Each Tsv In
asn.TimeScaleData(StartDate:=ActiveProject.ProjectStart,
EndDate:=ActiveProject.ProjectFinish, _
Type:=pjAssignmentTimescaledWork, timescaleunit:=pjTimescaleMonths, Count:=1)
xlRng = Val(Tsv.Value) / 60 / 7
Set xlRng = xlRng.Offset(0, 1)
colctr = colctr + 1
Next
Set xlRng = xlRng.Offset(1, -colctr)
End If
Next
End If
Next
End If
Set xlRng = xlRng.Offset(0, -1)
Next
Set xlRng = xlRng.Offset(0, -1)
Next
did a little sanity chack the other day and noticed that it always returns
the heading for the first month, but does do bring data back for that month
even though data exists in project.
Could someone tell me if I'm missing soemthing, bad variable name or counter
.. . . .etc. cause I can't see it.
Jeff
For Each Tsv In ActiveProject.ProjectSummaryTask.TimeScaleData( _
StartDate:=ActiveProject.ProjectStart, _
EndDate:=ActiveProject.ProjectFinish, _
Type:=pjAssignmentTimescaledWork, _
timescaleunit:=pjTimescaleMonths, _
Count:=1)
xlRng = Tsv.StartDate
Set xlRng = xlRng.Offset(0, 1)
colctr = colctr + 1
Next
Set xlRng = xlRng.Offset(1, -colctr)
'Print Resource Group
For Each Group In ActiveProject.ResourceGroup
xlRng = Project.Group.Name
Set xlRng = xlRng.Offset(0, 1)
'Print Resource; Name
For Each res In Proj.Resources
If Not (res Is Nothing) Then
xlRng = res.Name
Set xlRng = xlRng.Offset(0, 1)
'Print assignments
For Each tsk In ActiveProject.Tasks
If Not (tsk Is Nothing) Then
For Each asn In tsk.Assignments
If res.Name = asn.ResourceName Then
xlRng = tsk.Name
Set xlRng = xlRng.Offset(0, 1)
colctr = 1
For Each Tsv In
asn.TimeScaleData(StartDate:=ActiveProject.ProjectStart,
EndDate:=ActiveProject.ProjectFinish, _
Type:=pjAssignmentTimescaledWork, timescaleunit:=pjTimescaleMonths, Count:=1)
xlRng = Val(Tsv.Value) / 60 / 7
Set xlRng = xlRng.Offset(0, 1)
colctr = colctr + 1
Next
Set xlRng = xlRng.Offset(1, -colctr)
End If
Next
End If
Next
End If
Set xlRng = xlRng.Offset(0, -1)
Next
Set xlRng = xlRng.Offset(0, -1)
Next