R
Rudiger Wolf
Hi
I was wondering if there was a bug with the TimeScaleData method?
I'm trying to get hold of the fixed costs associated with a task. When I
run the subroutine below with Type:= pjTaskTimescaledFixedCost or Type:=
pjTaskTimescaledActualFixedCost the resultant data is always zero.
BUT when I use Type:=pjTaskTimescaledCumulativeCost then I get the
expected values coming back.
Is this a bug in the method or am I doing something wrong? How do I get
the time scaled fixed costs out of MS-Project via VBA?
Thanks
Rudi Wolf
Sub FixedCostsPerDay()
For Each T In ActiveProject.Tasks
If Not T Is Nothing Then
First = T.Start
Last = T.Finish
Debug.Print T.Name
Set TaskFixedCosts = T.TimeScaleData(First, Last, _
Type:=pjTaskTimescaledCumulativeCost, _
TimescaleUnit:=pjTimescaleDays)
Debug.Print TaskFixedCosts.Count
For i = 1 To TaskFixedCosts.Count
theFC = TaskFixedCosts(i).Value
If IsNumeric(theFC) Then Debug.Print "Fixed Cost for day
i=" & i & " £ = " & theFC
Next i
End If
Next T
End Sub
I was wondering if there was a bug with the TimeScaleData method?
I'm trying to get hold of the fixed costs associated with a task. When I
run the subroutine below with Type:= pjTaskTimescaledFixedCost or Type:=
pjTaskTimescaledActualFixedCost the resultant data is always zero.
BUT when I use Type:=pjTaskTimescaledCumulativeCost then I get the
expected values coming back.
Is this a bug in the method or am I doing something wrong? How do I get
the time scaled fixed costs out of MS-Project via VBA?
Thanks
Rudi Wolf
Sub FixedCostsPerDay()
For Each T In ActiveProject.Tasks
If Not T Is Nothing Then
First = T.Start
Last = T.Finish
Debug.Print T.Name
Set TaskFixedCosts = T.TimeScaleData(First, Last, _
Type:=pjTaskTimescaledCumulativeCost, _
TimescaleUnit:=pjTimescaleDays)
Debug.Print TaskFixedCosts.Count
For i = 1 To TaskFixedCosts.Count
theFC = TaskFixedCosts(i).Value
If IsNumeric(theFC) Then Debug.Print "Fixed Cost for day
i=" & i & " £ = " & theFC
Next i
End If
Next T
End Sub