Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

ProjectSummaryTask and TimeScaleValues Puzzle

$
0
0

I'm trying to load an internal array with BCWS and BCWP time scale values from the ProjectSummaryTask (code snippet listed below), and I'm having a weird problem.

The BCWS loads correctly, but the BCWP either does not load at all or (even more puzzling) loads up to the fourth array element and then does not update the values in the array. I know that the BCWP time scale values are being read: I display each tsv with a MsgBox, and I assign each value to a variable and watch the value change in the Locals window. But, the array update, which occurs right after the MsgBox and variable update, does not work.

Does anyone have an idea of what's causing this behavior, and what I can do to correct it?

Code:

           'For project summary task, get an array with each and every days BCWP

             Set tsvsBCWS = ProjectSummaryTask.TimeScaleData( _

             StartDate:=InputStartDate, EndDate:=InputFinishDate, _

             Type:=pjTaskTimescaledBCWS, TimeScaleUnit:=TimeScalePeriodLength, _

              Count:=1)

           'For project summary task, get an array with each and every days BCWP

            Set tsvsBCWP =ProjectSummaryTask.TimeScaleData( _

            StartDate:=InputStartDate, EndDate:=InputFinishDate, _

            Type:=pjTaskTimescaledBCWP, TimeScaleUnit:=TimeScalePeriodLength, _

            Count:=1)     

      

            'Insert this tasks BCWS into each period bucket

            j = 1

            For Each tsvBCWS In tsvsBCWS

               PeriodicBCWS(j) = VBA.Val(tsvBCWS.Value)

               j = j + 1

            Next tsvBCWS

            'Insert this tasks BCWP into each period bucket

            j = 1

            For Each tsvBCWP In tsvsBCWP

               MsgBox Val(tsvBCWP.Value) ‘display tsv

               x = Val(tsvBCWP.Value) ‘assign to variable

               PeriodicBCWP(j) = VBA.Val(tsvBCWP.Value)

               j = j + 1

            Next tsvBCWP


RobVV



Viewing all articles
Browse latest Browse all 5347


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>