Here’s the code that @Rachel provided:
Sub MSCostOutlay()
Dim tsv As TimeScaleValue
Dim tsvs As TimeScaleValues
Dim t As Task
For Each t In ActiveProject.Tasks
t.Baseline9Cost = t.BaselineCost
t.Baseline9Duration = Application.DateDifference(t.Start, t.Finish)
Set tsvs = t.TimeScaleData((t.Start), t.Finish, pjTaskTimescaledBaseline9Cost, pjTimescaleDays, 1)
For Each tsv In tsvs
If ActiveProject.Calendar.Period(tsv.StartDate, tsv.EndDate).Working Then
tsv = t.Baseline9Cost / (t.Baseline9Duration / (60 * 8))
End If
Next tsv
Next t
End Sub
I changed the Cost5 field to BaselineCost as I wasn’t using Cost5.
I have a MS Project19 schedule with ~ 1600 tasks and some inactive tasks. I’ve tried cutting down the size of the project to 200 tasks and deleted any Inactive tasks but it still gives me the Overflow 6 error. I’ve also tried to substitute (60*8) with 480 but no joy.
I suspect the overflow occurs at tsv = t.Baseline9Cost / (t.Baseline9Duration / (60 * 8)) but I haven’t been able to find a way to increase the size of tsv.
Any help would be appreciated.
I’m expecting to get Cost data by task to use in an Excel program.
Jack Fischer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.