Baseline Detection
-
15 iunie 2010 18:25What is the most reliable way to detect, using VBA, if a baseline has been set?
Toate mesajele
-
16 iunie 2010 00:34Moderator
To dermine the baseline assigned for Earned Value, try this
Application.ActiveProject.EarnedValueBaseline
It returns an integer representing the baseline used for EV Calculations.0, 1, 2, 3 ...
Once you know that, then you can check for the existence of a date:
Application.ActiveProject.BaselineSavedDate
If the value returned is a date, then you have it. If the value is not a date, then the baseline has not been set.
jeaksel at yahoo dot com- Editat de Jim AkselMVP, Moderator 16 iunie 2010 00:36 correct grammar, layout to make readable
- Marcat ca răspuns de RobVV 16 iunie 2010 13:33
-
16 iunie 2010 13:37Thanks, Jim. My post is the first for me on this forum (post TechNet). How do I mark your response as helpful?
-
16 iunie 2010 15:31Jim, the EarnedValueBaseline returns or sets the method for calculating EV, rather than indicating the baseline used in the calculation. The BaselineSavedDate is the one we want. If a baseline has not been set, it has the value of "NA"; otherwise, it has the date when the baseline was set.
-
16 iunie 2010 18:04ModeratorJust vote for it.
jeaksel at yahoo dot com -
16 iunie 2010 18:16Moderator
Actually, it appears the documentation disagrees with the behavior.
If you try this:
msgBox(ActiveProject.EarnedValueBaseline) it returns an integer reflecting the baseline currently assigned for use in EV caclulations.To change the method an indvidual task uses for EV:
dim tsk as task
tsk= assign the task to something
tsk.EarnedValueMethod = pjPercentComplete or pjPhysicalPercentComplete
If you want to check a specific baseline for a saved date:
ActiveProject.BaselineSavedDate(pjBaseline) or ActiveProject.BaselineSavedDate(pjBaseline2), etc.
You can change which baseline is used for the purposes of calculations:
OptionsCalculation EVBaseline:=ii where ii is an integer representing the baseline you want used. Sorry, I don't have the integer values handy, but I do know that Baseline4 = 15.
jeaksel at yahoo dot com