Status Baseline 
Author Message
 Status Baseline

What I am trying to do....
I have created a macro which will help me show
graphically, a status line against the baseline based on
Time Phased Values.  Basically I calculate a BCWP in hours
by multiplying (%WorkComplete * BaselineWork).  Note: all
of my tasks are fixed work.  My Macro then loops through
the Time Phased Values and Adds up Values until it hits
that calculated BCWP.  It then returns the end date of
that value into Finish 1.  I format my Bar Styles to show
progress from Baseline Start to Finish1.

The problem....
Seems to work great when I select multiple tasks and run
my macro UNTIL one of those tasks was not suppose to have
started yet (i.e. The baseline dates are later than the
current date).  What's weird is that if I select this task
by itself and run my macro it works fine.  I have watched
the macro in the local window and when it gets to the task
not scheduled to start yet, (When multiple tasks
selected), all of the Time Phased Values appear as "".  
Does anyone have the slightest clue what could cause this?

Thanks in advance.

Also, if there is an easier way to do this PLEASE let me
know.  I have just started to learn VBA for project and
really appreciate any help you can provide.

DMS



Fri, 25 Nov 2005 21:04:10 GMT  
 Status Baseline
Hi,

A timephased value of "" is the same as 0. I always use Val(tsv(i)) as that
produces 0 for "" values, but you can just test for "" and ignore or use 0.

--
Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/

Quote:
> What I am trying to do....
> I have created a macro which will help me show
> graphically, a status line against the baseline based on
> Time Phased Values.  Basically I calculate a BCWP in hours
> by multiplying (%WorkComplete * BaselineWork).  Note: all
> of my tasks are fixed work.  My Macro then loops through
> the Time Phased Values and Adds up Values until it hits
> that calculated BCWP.  It then returns the end date of
> that value into Finish 1.  I format my Bar Styles to show
> progress from Baseline Start to Finish1.

> The problem....
> Seems to work great when I select multiple tasks and run
> my macro UNTIL one of those tasks was not suppose to have
> started yet (i.e. The baseline dates are later than the
> current date).  What's weird is that if I select this task
> by itself and run my macro it works fine.  I have watched
> the macro in the local window and when it gets to the task
> not scheduled to start yet, (When multiple tasks
> selected), all of the Time Phased Values appear as "".
> Does anyone have the slightest clue what could cause this?

> Thanks in advance.

> Also, if there is an easier way to do this PLEASE let me
> know.  I have just started to learn VBA for project and
> really appreciate any help you can provide.

> DMS



Sat, 26 Nov 2005 04:05:23 GMT  
 Status Baseline
Rod,
The problem is that there actually is values in those time
phased elements, they just are showing up as "" when I try
to run the macro on multiple tasks.  If I run the macro
just one task the TSV appear.

Quote:
>-----Original Message-----
>Hi,

>A timephased value of "" is the same as 0. I always use
Val(tsv(i)) as that
>produces 0 for "" values, but you can just test for ""

and ignore or use 0.
Quote:

>--
>Rod Gill
>Project MVP
>For Microsoft Project companion projects, best practices
and Project VBA
>development services
>visit www.projectlearning.com/


>> What I am trying to do....
>> I have created a macro which will help me show
>> graphically, a status line against the baseline based on
>> Time Phased Values.  Basically I calculate a BCWP in
hours
>> by multiplying (%WorkComplete * BaselineWork).  Note:
all
>> of my tasks are fixed work.  My Macro then loops through
>> the Time Phased Values and Adds up Values until it hits
>> that calculated BCWP.  It then returns the end date of
>> that value into Finish 1.  I format my Bar Styles to
show
>> progress from Baseline Start to Finish1.

>> The problem....
>> Seems to work great when I select multiple tasks and run
>> my macro UNTIL one of those tasks was not suppose to
have
>> started yet (i.e. The baseline dates are later than the
>> current date).  What's weird is that if I select this
task
>> by itself and run my macro it works fine.  I have
watched
>> the macro in the local window and when it gets to the
task
>> not scheduled to start yet, (When multiple tasks
>> selected), all of the Time Phased Values appear as "".
>> Does anyone have the slightest clue what could cause
this?

>> Thanks in advance.

>> Also, if there is an easier way to do this PLEASE let me
>> know.  I have just started to learn VBA for project and
>> really appreciate any help you can provide.

>> DMS

>.



Sat, 26 Nov 2005 04:32:54 GMT  
 Status Baseline

DMS,
It might be easier to help find the problem if we could see your code.
If it isn't too lengthy (less than 50 lines), just post it here. If it
is long and involved send it to me via e-mail along with the zipped
project file and I'll have a look at it.

John



Sat, 26 Nov 2005 05:22:47 GMT  
 Status Baseline
Stated Problem,
If more than one task is selected and the following code
is run, If there is a task that is not yet scheduled to
start that task's Finish 1 field will not be calculated.

Tips: Baseline a couple of Tasks front loaded.  Make some
tasks set to start some time in the future.  Also I set my
barestyles to shade progress against the baseline from
Baseline Start to Finish1.

Here is the code.  I left the comments in so that you can
better understand why I was trying to write this code.  If
you see errors in the code outside of my stated problem,
then please give suggestins on that as well.  Thank You

 'This Macro was created by Dan XXX of XXX
    'Created on 6/5/03.
    'This macro was created in an attempt to status
against Baseline work instead of
    'Baseline Duration.  Statusing against Baseline
Duration is fine IF you do not
    'have any type of work curve.
    'The Problem
    'Assume the task below is 5 days long, has a BAC of
40hrs, and is 60% Complete.

                'Day1  Day2  Day3  Day4 Day5
                '12     12    8     4    4
    'DateDiff    ****************
    'TimePhased  ----------

    'Using a DateDiff Formula *****
    '5 Days * 60% = 3 Days

    'Using TimePhased Formula ------
    'BCWP = 24 hrs
    'Day 1 = 12  Sum = 12
    'Day 2 = 12  Sum = 24
    '*This is actually done like this on a hours basis

    'This macro works by incrementally adding up baseline
work by the hour for a task.
    'As soon as the Summed up work meets or exceeds the
calculated work percent complete
    'it stops and returns that hours end time.

Sub BLWorkPerDay()
    Dim TSV As TimeScaleValues, HowMany As Long
    Dim T As Task
    Dim SumValue As Long
    Dim HoursPerDay As String
    Dim CalcBCWP As Double
    Dim CalcEndDate As Date

    If Not (ActiveSelection.Tasks Is Nothing) Then
    For Each T In ActiveSelection.Tasks
    Set TSV = ActiveCell.Task.TimeScaleData
(T.BaselineStart, T.BaselineFinish,
pjTaskTimescaledBaselineWork, pjTimescaleHours, 1)
    SumValue = 0
    CalcBCWP = (T.PercentWorkComplete / 100) *
T.BaselineWork
    For HowMany = 1 To TSV.Count
        If Not TSV(HowMany).Value = "" Then
            If TSV(HowMany).Value + SumValue < CalcBCWP
Then
                SumValue = SumValue + TSV(HowMany).Value
            Else
                CalcEndDate = TSV(HowMany).EndDate
                T.Finish1 = CalcEndDate
                GoTo DansEnd
            End If
        End If
    Next HowMany
DansEnd:
    Next T
End If

End Sub

Quote:
>-----Original Message-----

>DMS,
>It might be easier to help find the problem if we could
see your code.
>If it isn't too lengthy (less than 50 lines), just post
it here. If it
>is long and involved send it to me via e-mail along with
the zipped
>project file and I'll have a look at it.

>John
>.



Sat, 26 Nov 2005 20:52:18 GMT  
 Status Baseline

DMS,
I'm going to run your macro on a test file I created but it may take a
couple of days - my ISP has problems and I have some other tasks to do.

John



Sun, 27 Nov 2005 23:55:04 GMT  
 Status Baseline
John,
I appreciate any help you can give.

Quote:
>-----Original Message-----

>DMS,
>I'm going to run your macro on a test file I created but
it may take a
>couple of days - my ISP has problems and I have some
other tasks to do.

>John
>.



Tue, 29 Nov 2005 23:45:24 GMT  
 Status Baseline
Hi!
...
For Each T In ActiveSelection.Tasks
    Set TSV = ActiveCell.Task.TimeScaleData
...

 Try:
For Each T In ActiveSelection.Tasks
    Set TSV = T.TimeScaleData

instead.

/Lars Hammarberg
www.camako.se


Quote:
> Stated Problem,
> If more than one task is selected and the following code
> is run, If there is a task that is not yet scheduled to
> start that task's Finish 1 field will not be calculated.

> Tips: Baseline a couple of Tasks front loaded.  Make some
> tasks set to start some time in the future.  Also I set my
> barestyles to shade progress against the baseline from
> Baseline Start to Finish1.

> Here is the code.  I left the comments in so that you can
> better understand why I was trying to write this code.  If
> you see errors in the code outside of my stated problem,
> then please give suggestins on that as well.  Thank You

>  'This Macro was created by Dan XXX of XXX
>     'Created on 6/5/03.
>     'This macro was created in an attempt to status
> against Baseline work instead of
>     'Baseline Duration.  Statusing against Baseline
> Duration is fine IF you do not
>     'have any type of work curve.
>     'The Problem
>     'Assume the task below is 5 days long, has a BAC of
> 40hrs, and is 60% Complete.

>                 'Day1  Day2  Day3  Day4 Day5
>                 '12     12    8     4    4
>     'DateDiff    ****************
>     'TimePhased  ----------

>     'Using a DateDiff Formula *****
>     '5 Days * 60% = 3 Days

>     'Using TimePhased Formula ------
>     'BCWP = 24 hrs
>     'Day 1 = 12  Sum = 12
>     'Day 2 = 12  Sum = 24
>     '*This is actually done like this on a hours basis

>     'This macro works by incrementally adding up baseline
> work by the hour for a task.
>     'As soon as the Summed up work meets or exceeds the
> calculated work percent complete
>     'it stops and returns that hours end time.

> Sub BLWorkPerDay()
>     Dim TSV As TimeScaleValues, HowMany As Long
>     Dim T As Task
>     Dim SumValue As Long
>     Dim HoursPerDay As String
>     Dim CalcBCWP As Double
>     Dim CalcEndDate As Date

>     If Not (ActiveSelection.Tasks Is Nothing) Then
>     For Each T In ActiveSelection.Tasks
>     Set TSV = ActiveCell.Task.TimeScaleData
> (T.BaselineStart, T.BaselineFinish,
> pjTaskTimescaledBaselineWork, pjTimescaleHours, 1)
>     SumValue = 0
>     CalcBCWP = (T.PercentWorkComplete / 100) *
> T.BaselineWork
>     For HowMany = 1 To TSV.Count
>         If Not TSV(HowMany).Value = "" Then
>             If TSV(HowMany).Value + SumValue < CalcBCWP
> Then
>                 SumValue = SumValue + TSV(HowMany).Value
>             Else
>                 CalcEndDate = TSV(HowMany).EndDate
>                 T.Finish1 = CalcEndDate
>                 GoTo DansEnd
>             End If
>         End If
>     Next HowMany
> DansEnd:
>     Next T
> End If

> End Sub

> >-----Original Message-----

> >DMS,
> >It might be easier to help find the problem if we could
> see your code.
> >If it isn't too lengthy (less than 50 lines), just post
> it here. If it
> >is long and involved send it to me via e-mail along with
> the zipped
> >project file and I'll have a look at it.

> >John
> >.



Sun, 04 Dec 2005 00:55:12 GMT  
 Status Baseline
It looks like that did it.  I am glad I checked the board
one more time, I was about to spend the evening at home
working on this.   THANK YOU VERY MUCH

Quote:
>-----Original Message-----
>Hi!

>....
>For Each T In ActiveSelection.Tasks
>    Set TSV = ActiveCell.Task.TimeScaleData
>....

> Try:
>For Each T In ActiveSelection.Tasks
>    Set TSV = T.TimeScaleData

>instead.

>/Lars Hammarberg
>www.camako.se



>> Stated Problem,
>> If more than one task is selected and the following code
>> is run, If there is a task that is not yet scheduled to
>> start that task's Finish 1 field will not be calculated.

>> Tips: Baseline a couple of Tasks front loaded.  Make
some
>> tasks set to start some time in the future.  Also I set
my
>> barestyles to shade progress against the baseline from
>> Baseline Start to Finish1.

>> Here is the code.  I left the comments in so that you
can
>> better understand why I was trying to write this code.  
If
>> you see errors in the code outside of my stated problem,
>> then please give suggestins on that as well.  Thank You

>>  'This Macro was created by Dan XXX of XXX
>>     'Created on 6/5/03.
>>     'This macro was created in an attempt to status
>> against Baseline work instead of
>>     'Baseline Duration.  Statusing against Baseline
>> Duration is fine IF you do not
>>     'have any type of work curve.
>>     'The Problem
>>     'Assume the task below is 5 days long, has a BAC of
>> 40hrs, and is 60% Complete.

>>                 'Day1  Day2  Day3  Day4 Day5
>>                 '12     12    8     4    4
>>     'DateDiff    ****************
>>     'TimePhased  ----------

>>     'Using a DateDiff Formula *****
>>     '5 Days * 60% = 3 Days

>>     'Using TimePhased Formula ------
>>     'BCWP = 24 hrs
>>     'Day 1 = 12  Sum = 12
>>     'Day 2 = 12  Sum = 24
>>     '*This is actually done like this on a hours basis

>>     'This macro works by incrementally adding up
baseline
>> work by the hour for a task.
>>     'As soon as the Summed up work meets or exceeds the
>> calculated work percent complete
>>     'it stops and returns that hours end time.

>> Sub BLWorkPerDay()
>>     Dim TSV As TimeScaleValues, HowMany As Long
>>     Dim T As Task
>>     Dim SumValue As Long
>>     Dim HoursPerDay As String
>>     Dim CalcBCWP As Double
>>     Dim CalcEndDate As Date

>>     If Not (ActiveSelection.Tasks Is Nothing) Then
>>     For Each T In ActiveSelection.Tasks
>>     Set TSV = ActiveCell.Task.TimeScaleData
>> (T.BaselineStart, T.BaselineFinish,
>> pjTaskTimescaledBaselineWork, pjTimescaleHours, 1)
>>     SumValue = 0
>>     CalcBCWP = (T.PercentWorkComplete / 100) *
>> T.BaselineWork
>>     For HowMany = 1 To TSV.Count
>>         If Not TSV(HowMany).Value = "" Then
>>             If TSV(HowMany).Value + SumValue < CalcBCWP
>> Then
>>                 SumValue = SumValue + TSV(HowMany).Value
>>             Else
>>                 CalcEndDate = TSV(HowMany).EndDate
>>                 T.Finish1 = CalcEndDate
>>                 GoTo DansEnd
>>             End If
>>         End If
>>     Next HowMany
>> DansEnd:
>>     Next T
>> End If

>> End Sub

>> >-----Original Message-----

>> >DMS,
>> >It might be easier to help find the problem if we could
>> see your code.
>> >If it isn't too lengthy (less than 50 lines), just post
>> it here. If it
>> >is long and involved send it to me via e-mail along
with
>> the zipped
>> >project file and I'll have a look at it.

>> >John
>> >.

>.



Sun, 04 Dec 2005 05:26:33 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. baseline adjustments

2. Protect Baseline Fields for overwritten ?

3. Disable or protect the baseline

4. Problems with Baseline-Dates and PercentWorkComplete in VBA

5. to check if baseline saved

6. Baseline for nested Projects

7. Help Setting Up Custom Cumulative Baseline Work Calculation

8. Baseline??

9. deactivate save with baseline-Dialog

10. Custom Field Formulas: Evaluating for Baseline Not Set / Variance Greater than Zero

11. Moving Interim/Baseline data to Start/Finish Fields

12. Multiple Baselines

 

 
Powered by phpBB® Forum Software