Determining the current phase of the project

D

Dan Roach

Greetings All

I am relatively new to Project Server and are attempting to use a Enterprise
Project Text field (which I have renamed Current Phase) to hold a value which
indicates the phase of the project. I have implemented a Enterprise Task Flag
that indicates whether a Task is completed, based on the % complete field. I
have then tried to use that flag inconjunction with the Task name to
calculate the current phase and store that in 'Current Phase'. I have Opened,
re-calculated and re-published a project, but the 'Current phase' field is
blank when view in a custom view on PWA.

Any ideas why this is not working or any suggestions on alternative methods
would be very gratefully received.

Thanks

Dan
 
D

Dominic Moss

Dan,

Does the "Current Phase" value calculate correctly in Microsoft Project
itself? I have been trying to design the same feature myself and my postings
drew a blank. If the value in MS Project calculates correctly you are closer
to resolution than I am.

To test the value is correct you could create a new table that includes the
Enterprise Project Text field, it will show the same value against every
task in your project plan. If it is delivering the correct value then check
how your Project Centre view is defined - Enterprise Project fields can be
used in these views whereas Enterprise Task fields will display in a Project
View.

I hope this is of some assistance, please let me know how you get on.

Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
 
T

TGG

Try this. We did something similar using milestones (Feasibility Phase
milestone, etc.) and whether or not they were completed to denote current
phase. We also wanted the info to show up in a PWA Project Center view so
that the person could export via Excel 2003. So, it had to be in the Project
Summary task. This has not been fully tested, so your mileage may vary.
Please use it as a demo to give you other ideas.

Here's the steps for setup.

1. Customize a Flag field to denote which milestones you want to evaluate.
For purposes of illustration, use Flag1 to do this. Then mark the milestones
to evaluate.

2. Customize Date2 to use the following formula and to rollup the Maximum
value.
IIf([Flag1]=Yes And [Finish]>DateValue([Current Date]) And [% Complete]<>100
And [% Complete]>0,ProjDateValue([Finish]),ProjDateValue('NA')) This puts
the finish date of the current phase milestone into this field.

3. Customize Text 1 with the following formula:
IIf(ProjDateValue([Date2])<>ProjDateValue('NA') And [Summary]=No,[Name],"")
This retrieves the name description of the current phase milestone.

4. Lastly, add the following macro code to move the Text 1 value to the
Project Summary rollup. You can't rollup text values for some reasons
without this.

Private Sub Project_BeforeSave(ByVal pj As MSProject.Project)

Dim t As Task
On Error GoTo ErrorHandler

Application.CalculateAll

For Each t In ActiveProject.Tasks
If t.Text1 <> "" Then
SetTaskField Field:="Text1", Value:=t.Text1, TaskID:="0"
End If
Next t

GoTo EndSub

ErrorHandler:

MsgBox Prompt:="Error Number: " & Err.Number, Buttons:=vbCritical, _
Title:="Set of Milestone To Summary Level Macro Error"

EndSub:
End Sub

If you autopublish, the values will get published to PWA automatically.
Otherwise, you have to remember to publish.

I hope this helps.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop
 
D

Dominic Moss

TGG,

That was a really useful answer as I have been trying to figure out how to
do this for a while now. I have followed your instructions but have to admit
I am not "comfortable" with Macros.

I have documented my actions in following your instructions from the custom
Flag field through to the Date field - I am assuming that these should use
Enterprise Task Flag, Text and Date fields in the Enterprise Global, I have
also created a new table to display these fields. I have tried to create a
Macro using your posted content in the Enterprise Global but am having
problems, can I ask you to provide an idiots step by step guide as to how to
complete this?

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
Try this. We did something similar using milestones (Feasibility Phase
milestone, etc.) and whether or not they were completed to denote current
phase. We also wanted the info to show up in a PWA Project Center view so
that the person could export via Excel 2003. So, it had to be in the
Project
Summary task. This has not been fully tested, so your mileage may vary.
Please use it as a demo to give you other ideas.

Here's the steps for setup.

1. Customize a Flag field to denote which milestones you want to
evaluate.
For purposes of illustration, use Flag1 to do this. Then mark the
milestones
to evaluate.

2. Customize Date2 to use the following formula and to rollup the Maximum
value.
IIf([Flag1]=Yes And [Finish]>DateValue([Current Date]) And [%
Complete]<>100
And [% Complete]>0,ProjDateValue([Finish]),ProjDateValue('NA')) This puts
the finish date of the current phase milestone into this field.

3. Customize Text 1 with the following formula:
IIf(ProjDateValue([Date2])<>ProjDateValue('NA') And
[Summary]=No,[Name],"")
This retrieves the name description of the current phase milestone.

4. Lastly, add the following macro code to move the Text 1 value to the
Project Summary rollup. You can't rollup text values for some reasons
without this.

Private Sub Project_BeforeSave(ByVal pj As MSProject.Project)

Dim t As Task
On Error GoTo ErrorHandler

Application.CalculateAll

For Each t In ActiveProject.Tasks
If t.Text1 <> "" Then
SetTaskField Field:="Text1", Value:=t.Text1, TaskID:="0"
End If
Next t

GoTo EndSub

ErrorHandler:

MsgBox Prompt:="Error Number: " & Err.Number, Buttons:=vbCritical, _
Title:="Set of Milestone To Summary Level Macro Error"

EndSub:
End Sub

If you autopublish, the values will get published to PWA automatically.
Otherwise, you have to remember to publish.

I hope this helps.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


Dominic Moss said:
Dan,

Does the "Current Phase" value calculate correctly in Microsoft Project
itself? I have been trying to design the same feature myself and my
postings
drew a blank. If the value in MS Project calculates correctly you are
closer
to resolution than I am.

To test the value is correct you could create a new table that includes
the
Enterprise Project Text field, it will show the same value against every
task in your project plan. If it is delivering the correct value then
check
how your Project Centre view is defined - Enterprise Project fields can
be
used in these views whereas Enterprise Task fields will display in a
Project
View.

I hope this is of some assistance, please let me know how you get on.

Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
 
T

TGG

Dominic,

I neglected to mention that macro security must be set to either Medium or
Low. Sorry about that. I prefer Medium since that provides the user with a
measure of control when opening unfamilar project plans.

In Project Pro, go to Tools, Macro, Macro Security and set appropriately.
You may also want to restart Project as a prudent measure.

I'm assuming you know how to get the macros into the macro editor, yes? If
not, press Alt+F11 in Project Pro to bring up the VB editor. The
"ThisProject" entry under VBAProject([name of open project]), Microsoft
Project Objects should be selected in the left pane. Open it if it is not
already open. Paste in the code. Save the project. You should be good to
go. If this doesn't help, let me know.

Thanks!
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop
new Project 12 blog: http://blogs.msdn.com/dieterz/


Dominic Moss said:
TGG,

That was a really useful answer as I have been trying to figure out how to
do this for a while now. I have followed your instructions but have to admit
I am not "comfortable" with Macros.

I have documented my actions in following your instructions from the custom
Flag field through to the Date field - I am assuming that these should use
Enterprise Task Flag, Text and Date fields in the Enterprise Global, I have
also created a new table to display these fields. I have tried to create a
Macro using your posted content in the Enterprise Global but am having
problems, can I ask you to provide an idiots step by step guide as to how to
complete this?

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
Try this. We did something similar using milestones (Feasibility Phase
milestone, etc.) and whether or not they were completed to denote current
phase. We also wanted the info to show up in a PWA Project Center view so
that the person could export via Excel 2003. So, it had to be in the
Project
Summary task. This has not been fully tested, so your mileage may vary.
Please use it as a demo to give you other ideas.

Here's the steps for setup.

1. Customize a Flag field to denote which milestones you want to
evaluate.
For purposes of illustration, use Flag1 to do this. Then mark the
milestones
to evaluate.

2. Customize Date2 to use the following formula and to rollup the Maximum
value.
IIf([Flag1]=Yes And [Finish]>DateValue([Current Date]) And [%
Complete]<>100
And [% Complete]>0,ProjDateValue([Finish]),ProjDateValue('NA')) This puts
the finish date of the current phase milestone into this field.

3. Customize Text 1 with the following formula:
IIf(ProjDateValue([Date2])<>ProjDateValue('NA') And
[Summary]=No,[Name],"")
This retrieves the name description of the current phase milestone.

4. Lastly, add the following macro code to move the Text 1 value to the
Project Summary rollup. You can't rollup text values for some reasons
without this.

Private Sub Project_BeforeSave(ByVal pj As MSProject.Project)

Dim t As Task
On Error GoTo ErrorHandler

Application.CalculateAll

For Each t In ActiveProject.Tasks
If t.Text1 <> "" Then
SetTaskField Field:="Text1", Value:=t.Text1, TaskID:="0"
End If
Next t

GoTo EndSub

ErrorHandler:

MsgBox Prompt:="Error Number: " & Err.Number, Buttons:=vbCritical, _
Title:="Set of Milestone To Summary Level Macro Error"

EndSub:
End Sub

If you autopublish, the values will get published to PWA automatically.
Otherwise, you have to remember to publish.

I hope this helps.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


Dominic Moss said:
Dan,

Does the "Current Phase" value calculate correctly in Microsoft Project
itself? I have been trying to design the same feature myself and my
postings
drew a blank. If the value in MS Project calculates correctly you are
closer
to resolution than I am.

To test the value is correct you could create a new table that includes
the
Enterprise Project Text field, it will show the same value against every
task in your project plan. If it is delivering the correct value then
check
how your Project Centre view is defined - Enterprise Project fields can
be
used in these views whereas Enterprise Task fields will display in a
Project
View.

I hope this is of some assistance, please let me know how you get on.

Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Greetings All

I am relatively new to Project Server and are attempting to use a
Enterprise
Project Text field (which I have renamed Current Phase) to hold a value
which
indicates the phase of the project. I have implemented a Enterprise
Task
Flag
that indicates whether a Task is completed, based on the % complete
field.
I
have then tried to use that flag inconjunction with the Task name to
calculate the current phase and store that in 'Current Phase'. I have
Opened,
re-calculated and re-published a project, but the 'Current phase' field
is
blank when view in a custom view on PWA.

Any ideas why this is not working or any suggestions on alternative
methods
would be very gratefully received.

Thanks

Dan
 
D

Dominic Moss

Hi TGG,

Many thanks for your continued input on this query.

Well I managed to set the Macro Security to low and re-started MOPP2003. I
opened the Ent Global and did ALT+F11 to display the Visual Basic Window
Macro. It displayed the ThisProject(EnterpriseGlobal) node. I then clicked
the View Code button which appears immediately above the Project-VBAProject
window and in the pane on the right hand side pasted the script you
provided. I clicked the Save button and then ALT+Q to return to MOPP2003.

When I next started up MOPP2003 I got the Security Warning dialogue box
which I assume indicates that my Macro is present? If I am in a session of
MOPP2003 with Macros disabled and then open the Enterprise Global I get the
security warning and once in the Ent Global if I go ALT+F11 I can see the
script for the Macro displayed in the pane on the right hand side.

However I do not appear to be getting this Macro to perform as expected.
When I open a project plan and display the "Phase" table I have created the
Phase Flag field says No by default and the Phase Date and Current Phase
columns display #ERROR in all rows. Changing a flag on a Milestone to Yes
clears the #ERROR values from all non-milestone unflagged tasks, however
summary tasks still show #ERROR and the Current Phase column shows no values
or #ERROR at all. Do the Summary Task and corresponding Milestone need to
have exactly the same text value?

I assume there is a simple answer to this which I am missing due to a lack
of Macro knowledge and hope you can help.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
Dominic,

I neglected to mention that macro security must be set to either Medium or
Low. Sorry about that. I prefer Medium since that provides the user with
a
measure of control when opening unfamilar project plans.

In Project Pro, go to Tools, Macro, Macro Security and set appropriately.
You may also want to restart Project as a prudent measure.

I'm assuming you know how to get the macros into the macro editor, yes?
If
not, press Alt+F11 in Project Pro to bring up the VB editor. The
"ThisProject" entry under VBAProject([name of open project]), Microsoft
Project Objects should be selected in the left pane. Open it if it is not
already open. Paste in the code. Save the project. You should be good
to
go. If this doesn't help, let me know.

Thanks!
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop
new Project 12 blog: http://blogs.msdn.com/dieterz/


Dominic Moss said:
TGG,

That was a really useful answer as I have been trying to figure out how
to
do this for a while now. I have followed your instructions but have to
admit
I am not "comfortable" with Macros.

I have documented my actions in following your instructions from the
custom
Flag field through to the Date field - I am assuming that these should
use
Enterprise Task Flag, Text and Date fields in the Enterprise Global, I
have
also created a new table to display these fields. I have tried to create
a
Macro using your posted content in the Enterprise Global but am having
problems, can I ask you to provide an idiots step by step guide as to how
to
complete this?

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
Try this. We did something similar using milestones (Feasibility Phase
milestone, etc.) and whether or not they were completed to denote
current
phase. We also wanted the info to show up in a PWA Project Center view
so
that the person could export via Excel 2003. So, it had to be in the
Project
Summary task. This has not been fully tested, so your mileage may
vary.
Please use it as a demo to give you other ideas.

Here's the steps for setup.

1. Customize a Flag field to denote which milestones you want to
evaluate.
For purposes of illustration, use Flag1 to do this. Then mark the
milestones
to evaluate.

2. Customize Date2 to use the following formula and to rollup the
Maximum
value.
IIf([Flag1]=Yes And [Finish]>DateValue([Current Date]) And [%
Complete]<>100
And [% Complete]>0,ProjDateValue([Finish]),ProjDateValue('NA')) This
puts
the finish date of the current phase milestone into this field.

3. Customize Text 1 with the following formula:
IIf(ProjDateValue([Date2])<>ProjDateValue('NA') And
[Summary]=No,[Name],"")
This retrieves the name description of the current phase milestone.

4. Lastly, add the following macro code to move the Text 1 value to
the
Project Summary rollup. You can't rollup text values for some reasons
without this.

Private Sub Project_BeforeSave(ByVal pj As MSProject.Project)

Dim t As Task
On Error GoTo ErrorHandler

Application.CalculateAll

For Each t In ActiveProject.Tasks
If t.Text1 <> "" Then
SetTaskField Field:="Text1", Value:=t.Text1, TaskID:="0"
End If
Next t

GoTo EndSub

ErrorHandler:

MsgBox Prompt:="Error Number: " & Err.Number, Buttons:=vbCritical, _
Title:="Set of Milestone To Summary Level Macro Error"

EndSub:
End Sub

If you autopublish, the values will get published to PWA automatically.
Otherwise, you have to remember to publish.

I hope this helps.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


:

Dan,

Does the "Current Phase" value calculate correctly in Microsoft
Project
itself? I have been trying to design the same feature myself and my
postings
drew a blank. If the value in MS Project calculates correctly you are
closer
to resolution than I am.

To test the value is correct you could create a new table that
includes
the
Enterprise Project Text field, it will show the same value against
every
task in your project plan. If it is delivering the correct value then
check
how your Project Centre view is defined - Enterprise Project fields
can
be
used in these views whereas Enterprise Task fields will display in a
Project
View.

I hope this is of some assistance, please let me know how you get on.

Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Greetings All

I am relatively new to Project Server and are attempting to use a
Enterprise
Project Text field (which I have renamed Current Phase) to hold a
value
which
indicates the phase of the project. I have implemented a Enterprise
Task
Flag
that indicates whether a Task is completed, based on the % complete
field.
I
have then tried to use that flag inconjunction with the Task name to
calculate the current phase and store that in 'Current Phase'. I
have
Opened,
re-calculated and re-published a project, but the 'Current phase'
field
is
blank when view in a custom view on PWA.

Any ideas why this is not working or any suggestions on alternative
methods
would be very gratefully received.

Thanks

Dan
 
T

TGG

Let's see. First, you want to enable macros, otherwise the macro won't run.

The #error appears to be related to the formulas. Did you use the exact
custom field names that I specified? If not, the names in the formulas need
to be updated. Also, might want to double-check for all the parentheses, etc.

I think you are really close. Keep me posted.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


Dominic Moss said:
Hi TGG,

Many thanks for your continued input on this query.

Well I managed to set the Macro Security to low and re-started MOPP2003. I
opened the Ent Global and did ALT+F11 to display the Visual Basic Window
Macro. It displayed the ThisProject(EnterpriseGlobal) node. I then clicked
the View Code button which appears immediately above the Project-VBAProject
window and in the pane on the right hand side pasted the script you
provided. I clicked the Save button and then ALT+Q to return to MOPP2003.

When I next started up MOPP2003 I got the Security Warning dialogue box
which I assume indicates that my Macro is present? If I am in a session of
MOPP2003 with Macros disabled and then open the Enterprise Global I get the
security warning and once in the Ent Global if I go ALT+F11 I can see the
script for the Macro displayed in the pane on the right hand side.

However I do not appear to be getting this Macro to perform as expected.
When I open a project plan and display the "Phase" table I have created the
Phase Flag field says No by default and the Phase Date and Current Phase
columns display #ERROR in all rows. Changing a flag on a Milestone to Yes
clears the #ERROR values from all non-milestone unflagged tasks, however
summary tasks still show #ERROR and the Current Phase column shows no values
or #ERROR at all. Do the Summary Task and corresponding Milestone need to
have exactly the same text value?

I assume there is a simple answer to this which I am missing due to a lack
of Macro knowledge and hope you can help.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
Dominic,

I neglected to mention that macro security must be set to either Medium or
Low. Sorry about that. I prefer Medium since that provides the user with
a
measure of control when opening unfamilar project plans.

In Project Pro, go to Tools, Macro, Macro Security and set appropriately.
You may also want to restart Project as a prudent measure.

I'm assuming you know how to get the macros into the macro editor, yes?
If
not, press Alt+F11 in Project Pro to bring up the VB editor. The
"ThisProject" entry under VBAProject([name of open project]), Microsoft
Project Objects should be selected in the left pane. Open it if it is not
already open. Paste in the code. Save the project. You should be good
to
go. If this doesn't help, let me know.

Thanks!
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop
new Project 12 blog: http://blogs.msdn.com/dieterz/


Dominic Moss said:
TGG,

That was a really useful answer as I have been trying to figure out how
to
do this for a while now. I have followed your instructions but have to
admit
I am not "comfortable" with Macros.

I have documented my actions in following your instructions from the
custom
Flag field through to the Date field - I am assuming that these should
use
Enterprise Task Flag, Text and Date fields in the Enterprise Global, I
have
also created a new table to display these fields. I have tried to create
a
Macro using your posted content in the Enterprise Global but am having
problems, can I ask you to provide an idiots step by step guide as to how
to
complete this?

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Try this. We did something similar using milestones (Feasibility Phase
milestone, etc.) and whether or not they were completed to denote
current
phase. We also wanted the info to show up in a PWA Project Center view
so
that the person could export via Excel 2003. So, it had to be in the
Project
Summary task. This has not been fully tested, so your mileage may
vary.
Please use it as a demo to give you other ideas.

Here's the steps for setup.

1. Customize a Flag field to denote which milestones you want to
evaluate.
For purposes of illustration, use Flag1 to do this. Then mark the
milestones
to evaluate.

2. Customize Date2 to use the following formula and to rollup the
Maximum
value.
IIf([Flag1]=Yes And [Finish]>DateValue([Current Date]) And [%
Complete]<>100
And [% Complete]>0,ProjDateValue([Finish]),ProjDateValue('NA')) This
puts
the finish date of the current phase milestone into this field.

3. Customize Text 1 with the following formula:
IIf(ProjDateValue([Date2])<>ProjDateValue('NA') And
[Summary]=No,[Name],"")
This retrieves the name description of the current phase milestone.

4. Lastly, add the following macro code to move the Text 1 value to
the
Project Summary rollup. You can't rollup text values for some reasons
without this.

Private Sub Project_BeforeSave(ByVal pj As MSProject.Project)

Dim t As Task
On Error GoTo ErrorHandler

Application.CalculateAll

For Each t In ActiveProject.Tasks
If t.Text1 <> "" Then
SetTaskField Field:="Text1", Value:=t.Text1, TaskID:="0"
End If
Next t

GoTo EndSub

ErrorHandler:

MsgBox Prompt:="Error Number: " & Err.Number, Buttons:=vbCritical, _
Title:="Set of Milestone To Summary Level Macro Error"

EndSub:
End Sub

If you autopublish, the values will get published to PWA automatically.
Otherwise, you have to remember to publish.

I hope this helps.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


:

Dan,

Does the "Current Phase" value calculate correctly in Microsoft
Project
itself? I have been trying to design the same feature myself and my
postings
drew a blank. If the value in MS Project calculates correctly you are
closer
to resolution than I am.

To test the value is correct you could create a new table that
includes
the
Enterprise Project Text field, it will show the same value against
every
task in your project plan. If it is delivering the correct value then
check
how your Project Centre view is defined - Enterprise Project fields
can
be
used in these views whereas Enterprise Task fields will display in a
Project
View.

I hope this is of some assistance, please let me know how you get on.

Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Greetings All

I am relatively new to Project Server and are attempting to use a
Enterprise
Project Text field (which I have renamed Current Phase) to hold a
value
which
indicates the phase of the project. I have implemented a Enterprise
Task
Flag
that indicates whether a Task is completed, based on the % complete
field.
I
have then tried to use that flag inconjunction with the Task name to
calculate the current phase and store that in 'Current Phase'. I
have
Opened,
re-calculated and re-published a project, but the 'Current phase'
field
is
blank when view in a custom view on PWA.

Any ideas why this is not working or any suggestions on alternative
methods
would be very gratefully received.

Thanks

Dan
 
D

Dominic Moss

Thanks for the latest nudge in the right direction.

I first off defined the Enterprise Task Fields with new names. When defining
the formulas I used the custom names for the fields but noted that MOPP2003
automatically corrects this with the default name of the field in [ ]
brackets. I copied the formulas as you posted them, in one instance I got an
error message which I corrected, in my experience MOPP2003 will not let you
complete and save a custom field if there is an error in a formula.

I am off working with clients here in the UK Thursday and Friday so will
resume this thread either at the weekend or next Monday. Thanks for your
continued assistance.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
Let's see. First, you want to enable macros, otherwise the macro won't
run.

The #error appears to be related to the formulas. Did you use the exact
custom field names that I specified? If not, the names in the formulas
need
to be updated. Also, might want to double-check for all the parentheses,
etc.

I think you are really close. Keep me posted.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


Dominic Moss said:
Hi TGG,

Many thanks for your continued input on this query.

Well I managed to set the Macro Security to low and re-started MOPP2003.
I
opened the Ent Global and did ALT+F11 to display the Visual Basic Window
Macro. It displayed the ThisProject(EnterpriseGlobal) node. I then
clicked
the View Code button which appears immediately above the
Project-VBAProject
window and in the pane on the right hand side pasted the script you
provided. I clicked the Save button and then ALT+Q to return to MOPP2003.

When I next started up MOPP2003 I got the Security Warning dialogue box
which I assume indicates that my Macro is present? If I am in a session
of
MOPP2003 with Macros disabled and then open the Enterprise Global I get
the
security warning and once in the Ent Global if I go ALT+F11 I can see the
script for the Macro displayed in the pane on the right hand side.

However I do not appear to be getting this Macro to perform as expected.
When I open a project plan and display the "Phase" table I have created
the
Phase Flag field says No by default and the Phase Date and Current Phase
columns display #ERROR in all rows. Changing a flag on a Milestone to Yes
clears the #ERROR values from all non-milestone unflagged tasks, however
summary tasks still show #ERROR and the Current Phase column shows no
values
or #ERROR at all. Do the Summary Task and corresponding Milestone need to
have exactly the same text value?

I assume there is a simple answer to this which I am missing due to a
lack
of Macro knowledge and hope you can help.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
Dominic,

I neglected to mention that macro security must be set to either Medium
or
Low. Sorry about that. I prefer Medium since that provides the user
with
a
measure of control when opening unfamilar project plans.

In Project Pro, go to Tools, Macro, Macro Security and set
appropriately.
You may also want to restart Project as a prudent measure.

I'm assuming you know how to get the macros into the macro editor, yes?
If
not, press Alt+F11 in Project Pro to bring up the VB editor. The
"ThisProject" entry under VBAProject([name of open project]), Microsoft
Project Objects should be selected in the left pane. Open it if it is
not
already open. Paste in the code. Save the project. You should be
good
to
go. If this doesn't help, let me know.

Thanks!
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop
new Project 12 blog: http://blogs.msdn.com/dieterz/


:

TGG,

That was a really useful answer as I have been trying to figure out
how
to
do this for a while now. I have followed your instructions but have to
admit
I am not "comfortable" with Macros.

I have documented my actions in following your instructions from the
custom
Flag field through to the Date field - I am assuming that these should
use
Enterprise Task Flag, Text and Date fields in the Enterprise Global, I
have
also created a new table to display these fields. I have tried to
create
a
Macro using your posted content in the Enterprise Global but am having
problems, can I ask you to provide an idiots step by step guide as to
how
to
complete this?

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Try this. We did something similar using milestones (Feasibility
Phase
milestone, etc.) and whether or not they were completed to denote
current
phase. We also wanted the info to show up in a PWA Project Center
view
so
that the person could export via Excel 2003. So, it had to be in
the
Project
Summary task. This has not been fully tested, so your mileage may
vary.
Please use it as a demo to give you other ideas.

Here's the steps for setup.

1. Customize a Flag field to denote which milestones you want to
evaluate.
For purposes of illustration, use Flag1 to do this. Then mark the
milestones
to evaluate.

2. Customize Date2 to use the following formula and to rollup the
Maximum
value.
IIf([Flag1]=Yes And [Finish]>DateValue([Current Date]) And [%
Complete]<>100
And [% Complete]>0,ProjDateValue([Finish]),ProjDateValue('NA'))
This
puts
the finish date of the current phase milestone into this field.

3. Customize Text 1 with the following formula:
IIf(ProjDateValue([Date2])<>ProjDateValue('NA') And
[Summary]=No,[Name],"")
This retrieves the name description of the current phase milestone.

4. Lastly, add the following macro code to move the Text 1 value to
the
Project Summary rollup. You can't rollup text values for some
reasons
without this.

Private Sub Project_BeforeSave(ByVal pj As MSProject.Project)

Dim t As Task
On Error GoTo ErrorHandler

Application.CalculateAll

For Each t In ActiveProject.Tasks
If t.Text1 <> "" Then
SetTaskField Field:="Text1", Value:=t.Text1, TaskID:="0"
End If
Next t

GoTo EndSub

ErrorHandler:

MsgBox Prompt:="Error Number: " & Err.Number,
Buttons:=vbCritical, _
Title:="Set of Milestone To Summary Level Macro Error"

EndSub:
End Sub

If you autopublish, the values will get published to PWA
automatically.
Otherwise, you have to remember to publish.

I hope this helps.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


:

Dan,

Does the "Current Phase" value calculate correctly in Microsoft
Project
itself? I have been trying to design the same feature myself and my
postings
drew a blank. If the value in MS Project calculates correctly you
are
closer
to resolution than I am.

To test the value is correct you could create a new table that
includes
the
Enterprise Project Text field, it will show the same value against
every
task in your project plan. If it is delivering the correct value
then
check
how your Project Centre view is defined - Enterprise Project fields
can
be
used in these views whereas Enterprise Task fields will display in
a
Project
View.

I hope this is of some assistance, please let me know how you get
on.

Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Greetings All

I am relatively new to Project Server and are attempting to use a
Enterprise
Project Text field (which I have renamed Current Phase) to hold a
value
which
indicates the phase of the project. I have implemented a
Enterprise
Task
Flag
that indicates whether a Task is completed, based on the %
complete
field.
I
have then tried to use that flag inconjunction with the Task name
to
calculate the current phase and store that in 'Current Phase'. I
have
Opened,
re-calculated and re-published a project, but the 'Current phase'
field
is
blank when view in a custom view on PWA.

Any ideas why this is not working or any suggestions on
alternative
methods
would be very gratefully received.

Thanks

Dan
 
T

TGG

I sent you an email from my Yahoo account with an additional request.
Hopefully, you received it. If not, let me know.

Thanks!
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop

Dominic Moss said:
Thanks for the latest nudge in the right direction.

I first off defined the Enterprise Task Fields with new names. When defining
the formulas I used the custom names for the fields but noted that MOPP2003
automatically corrects this with the default name of the field in [ ]
brackets. I copied the formulas as you posted them, in one instance I got an
error message which I corrected, in my experience MOPP2003 will not let you
complete and save a custom field if there is an error in a formula.

I am off working with clients here in the UK Thursday and Friday so will
resume this thread either at the weekend or next Monday. Thanks for your
continued assistance.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
Let's see. First, you want to enable macros, otherwise the macro won't
run.

The #error appears to be related to the formulas. Did you use the exact
custom field names that I specified? If not, the names in the formulas
need
to be updated. Also, might want to double-check for all the parentheses,
etc.

I think you are really close. Keep me posted.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


Dominic Moss said:
Hi TGG,

Many thanks for your continued input on this query.

Well I managed to set the Macro Security to low and re-started MOPP2003.
I
opened the Ent Global and did ALT+F11 to display the Visual Basic Window
Macro. It displayed the ThisProject(EnterpriseGlobal) node. I then
clicked
the View Code button which appears immediately above the
Project-VBAProject
window and in the pane on the right hand side pasted the script you
provided. I clicked the Save button and then ALT+Q to return to MOPP2003.

When I next started up MOPP2003 I got the Security Warning dialogue box
which I assume indicates that my Macro is present? If I am in a session
of
MOPP2003 with Macros disabled and then open the Enterprise Global I get
the
security warning and once in the Ent Global if I go ALT+F11 I can see the
script for the Macro displayed in the pane on the right hand side.

However I do not appear to be getting this Macro to perform as expected.
When I open a project plan and display the "Phase" table I have created
the
Phase Flag field says No by default and the Phase Date and Current Phase
columns display #ERROR in all rows. Changing a flag on a Milestone to Yes
clears the #ERROR values from all non-milestone unflagged tasks, however
summary tasks still show #ERROR and the Current Phase column shows no
values
or #ERROR at all. Do the Summary Task and corresponding Milestone need to
have exactly the same text value?

I assume there is a simple answer to this which I am missing due to a
lack
of Macro knowledge and hope you can help.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Dominic,

I neglected to mention that macro security must be set to either Medium
or
Low. Sorry about that. I prefer Medium since that provides the user
with
a
measure of control when opening unfamilar project plans.

In Project Pro, go to Tools, Macro, Macro Security and set
appropriately.
You may also want to restart Project as a prudent measure.

I'm assuming you know how to get the macros into the macro editor, yes?
If
not, press Alt+F11 in Project Pro to bring up the VB editor. The
"ThisProject" entry under VBAProject([name of open project]), Microsoft
Project Objects should be selected in the left pane. Open it if it is
not
already open. Paste in the code. Save the project. You should be
good
to
go. If this doesn't help, let me know.

Thanks!
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop
new Project 12 blog: http://blogs.msdn.com/dieterz/


:

TGG,

That was a really useful answer as I have been trying to figure out
how
to
do this for a while now. I have followed your instructions but have to
admit
I am not "comfortable" with Macros.

I have documented my actions in following your instructions from the
custom
Flag field through to the Date field - I am assuming that these should
use
Enterprise Task Flag, Text and Date fields in the Enterprise Global, I
have
also created a new table to display these fields. I have tried to
create
a
Macro using your posted content in the Enterprise Global but am having
problems, can I ask you to provide an idiots step by step guide as to
how
to
complete this?

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Try this. We did something similar using milestones (Feasibility
Phase
milestone, etc.) and whether or not they were completed to denote
current
phase. We also wanted the info to show up in a PWA Project Center
view
so
that the person could export via Excel 2003. So, it had to be in
the
Project
Summary task. This has not been fully tested, so your mileage may
vary.
Please use it as a demo to give you other ideas.

Here's the steps for setup.

1. Customize a Flag field to denote which milestones you want to
evaluate.
For purposes of illustration, use Flag1 to do this. Then mark the
milestones
to evaluate.

2. Customize Date2 to use the following formula and to rollup the
Maximum
value.
IIf([Flag1]=Yes And [Finish]>DateValue([Current Date]) And [%
Complete]<>100
And [% Complete]>0,ProjDateValue([Finish]),ProjDateValue('NA'))
This
puts
the finish date of the current phase milestone into this field.

3. Customize Text 1 with the following formula:
IIf(ProjDateValue([Date2])<>ProjDateValue('NA') And
[Summary]=No,[Name],"")
This retrieves the name description of the current phase milestone.

4. Lastly, add the following macro code to move the Text 1 value to
the
Project Summary rollup. You can't rollup text values for some
reasons
without this.

Private Sub Project_BeforeSave(ByVal pj As MSProject.Project)

Dim t As Task
On Error GoTo ErrorHandler

Application.CalculateAll

For Each t In ActiveProject.Tasks
If t.Text1 <> "" Then
SetTaskField Field:="Text1", Value:=t.Text1, TaskID:="0"
End If
Next t

GoTo EndSub

ErrorHandler:

MsgBox Prompt:="Error Number: " & Err.Number,
Buttons:=vbCritical, _
Title:="Set of Milestone To Summary Level Macro Error"

EndSub:
End Sub

If you autopublish, the values will get published to PWA
automatically.
Otherwise, you have to remember to publish.

I hope this helps.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


:

Dan,

Does the "Current Phase" value calculate correctly in Microsoft
Project
itself? I have been trying to design the same feature myself and my
postings
drew a blank. If the value in MS Project calculates correctly you
are
closer
to resolution than I am.

To test the value is correct you could create a new table that
includes
the
Enterprise Project Text field, it will show the same value against
every
task in your project plan. If it is delivering the correct value
then
check
how your Project Centre view is defined - Enterprise Project fields
can
be
used in these views whereas Enterprise Task fields will display in
a
Project
View.

I hope this is of some assistance, please let me know how you get
on.

Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Greetings All

I am relatively new to Project Server and are attempting to use a
Enterprise
Project Text field (which I have renamed Current Phase) to hold a
value
which
indicates the phase of the project. I have implemented a
Enterprise
Task
Flag
that indicates whether a Task is completed, based on the %
complete
field.
I
have then tried to use that flag inconjunction with the Task name
to
calculate the current phase and store that in 'Current Phase'. I
have
Opened,
re-calculated and re-published a project, but the 'Current phase'
field
is
blank when view in a custom view on PWA.
 
D

Dan Roach

Thanks for the info TGG (and discussion Dominic), it is a good solution and I
am very close to it working 100%.

I have implemented as you suggested, and the variables evaluate correctly
(ie. The milestone name is present in Text 1 in Project Pro.) I am having
some probelms with the Macro and viewing the Text 1 field in PWA. I have
changed the macro security and have added the macro code. I have added to the
macro code to the Ent global ( This project) file. It does not seem to do
anything, but when closing Project Pro, I get the Macro error message, with
error number 1100? Also, when the macro is working correctly, which field do
I have ato add to my views in the PWA so I can see the value?

Any help would be very gratefully received.
Thanks
Dan


TGG said:
I sent you an email from my Yahoo account with an additional request.
Hopefully, you received it. If not, let me know.

Thanks!
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop

Dominic Moss said:
Thanks for the latest nudge in the right direction.

I first off defined the Enterprise Task Fields with new names. When defining
the formulas I used the custom names for the fields but noted that MOPP2003
automatically corrects this with the default name of the field in [ ]
brackets. I copied the formulas as you posted them, in one instance I got an
error message which I corrected, in my experience MOPP2003 will not let you
complete and save a custom field if there is an error in a formula.

I am off working with clients here in the UK Thursday and Friday so will
resume this thread either at the weekend or next Monday. Thanks for your
continued assistance.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
Let's see. First, you want to enable macros, otherwise the macro won't
run.

The #error appears to be related to the formulas. Did you use the exact
custom field names that I specified? If not, the names in the formulas
need
to be updated. Also, might want to double-check for all the parentheses,
etc.

I think you are really close. Keep me posted.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


:

Hi TGG,

Many thanks for your continued input on this query.

Well I managed to set the Macro Security to low and re-started MOPP2003.
I
opened the Ent Global and did ALT+F11 to display the Visual Basic Window
Macro. It displayed the ThisProject(EnterpriseGlobal) node. I then
clicked
the View Code button which appears immediately above the
Project-VBAProject
window and in the pane on the right hand side pasted the script you
provided. I clicked the Save button and then ALT+Q to return to MOPP2003.

When I next started up MOPP2003 I got the Security Warning dialogue box
which I assume indicates that my Macro is present? If I am in a session
of
MOPP2003 with Macros disabled and then open the Enterprise Global I get
the
security warning and once in the Ent Global if I go ALT+F11 I can see the
script for the Macro displayed in the pane on the right hand side.

However I do not appear to be getting this Macro to perform as expected.
When I open a project plan and display the "Phase" table I have created
the
Phase Flag field says No by default and the Phase Date and Current Phase
columns display #ERROR in all rows. Changing a flag on a Milestone to Yes
clears the #ERROR values from all non-milestone unflagged tasks, however
summary tasks still show #ERROR and the Current Phase column shows no
values
or #ERROR at all. Do the Summary Task and corresponding Milestone need to
have exactly the same text value?

I assume there is a simple answer to this which I am missing due to a
lack
of Macro knowledge and hope you can help.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Dominic,

I neglected to mention that macro security must be set to either Medium
or
Low. Sorry about that. I prefer Medium since that provides the user
with
a
measure of control when opening unfamilar project plans.

In Project Pro, go to Tools, Macro, Macro Security and set
appropriately.
You may also want to restart Project as a prudent measure.

I'm assuming you know how to get the macros into the macro editor, yes?
If
not, press Alt+F11 in Project Pro to bring up the VB editor. The
"ThisProject" entry under VBAProject([name of open project]), Microsoft
Project Objects should be selected in the left pane. Open it if it is
not
already open. Paste in the code. Save the project. You should be
good
to
go. If this doesn't help, let me know.

Thanks!
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop
new Project 12 blog: http://blogs.msdn.com/dieterz/


:

TGG,

That was a really useful answer as I have been trying to figure out
how
to
do this for a while now. I have followed your instructions but have to
admit
I am not "comfortable" with Macros.

I have documented my actions in following your instructions from the
custom
Flag field through to the Date field - I am assuming that these should
use
Enterprise Task Flag, Text and Date fields in the Enterprise Global, I
have
also created a new table to display these fields. I have tried to
create
a
Macro using your posted content in the Enterprise Global but am having
problems, can I ask you to provide an idiots step by step guide as to
how
to
complete this?

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Try this. We did something similar using milestones (Feasibility
Phase
milestone, etc.) and whether or not they were completed to denote
current
phase. We also wanted the info to show up in a PWA Project Center
view
so
that the person could export via Excel 2003. So, it had to be in
the
Project
Summary task. This has not been fully tested, so your mileage may
vary.
Please use it as a demo to give you other ideas.

Here's the steps for setup.

1. Customize a Flag field to denote which milestones you want to
evaluate.
For purposes of illustration, use Flag1 to do this. Then mark the
milestones
to evaluate.

2. Customize Date2 to use the following formula and to rollup the
Maximum
value.
IIf([Flag1]=Yes And [Finish]>DateValue([Current Date]) And [%
Complete]<>100
And [% Complete]>0,ProjDateValue([Finish]),ProjDateValue('NA'))
This
puts
the finish date of the current phase milestone into this field.

3. Customize Text 1 with the following formula:
IIf(ProjDateValue([Date2])<>ProjDateValue('NA') And
[Summary]=No,[Name],"")
This retrieves the name description of the current phase milestone.

4. Lastly, add the following macro code to move the Text 1 value to
the
Project Summary rollup. You can't rollup text values for some
reasons
without this.

Private Sub Project_BeforeSave(ByVal pj As MSProject.Project)

Dim t As Task
On Error GoTo ErrorHandler

Application.CalculateAll

For Each t In ActiveProject.Tasks
If t.Text1 <> "" Then
SetTaskField Field:="Text1", Value:=t.Text1, TaskID:="0"
End If
Next t

GoTo EndSub

ErrorHandler:

MsgBox Prompt:="Error Number: " & Err.Number,
Buttons:=vbCritical, _
Title:="Set of Milestone To Summary Level Macro Error"

EndSub:
End Sub

If you autopublish, the values will get published to PWA
automatically.
Otherwise, you have to remember to publish.

I hope this helps.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


:

Dan,

Does the "Current Phase" value calculate correctly in Microsoft
Project
itself? I have been trying to design the same feature myself and my
postings
drew a blank. If the value in MS Project calculates correctly you
are
closer
to resolution than I am.

To test the value is correct you could create a new table that
includes
the
Enterprise Project Text field, it will show the same value against
every
task in your project plan. If it is delivering the correct value
then
check
how your Project Centre view is defined - Enterprise Project fields
can
be
used in these views whereas Enterprise Task fields will display in
a
Project
View.

I hope this is of some assistance, please let me know how you get
on.

Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Greetings All

I am relatively new to Project Server and are attempting to use a
Enterprise
Project Text field (which I have renamed Current Phase) to hold a
value
which
indicates the phase of the project. I have implemented a
Enterprise
Task
Flag
that indicates whether a Task is completed, based on the %
complete
field.
 
D

Dominic Moss

Sorry - no e-mail received - can I suggest you try to contact me through
this page http://www.projectability.co.uk/genres.shtml .

I am still plodding away and not getting the same results as reported by
Dan - I am using Enterprise Flag, Date and Text fields and referencing them
correctly in the Formulas for both Date2 and Text1. If there were any
problem in the Formula I am sure there would be an error message at the
time. I have compiled all of my actions into a document which I can provide
when I have your e-mail address.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
I sent you an email from my Yahoo account with an additional request.
Hopefully, you received it. If not, let me know.

Thanks!
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop

Dominic Moss said:
Thanks for the latest nudge in the right direction.

I first off defined the Enterprise Task Fields with new names. When
defining
the formulas I used the custom names for the fields but noted that
MOPP2003
automatically corrects this with the default name of the field in [ ]
brackets. I copied the formulas as you posted them, in one instance I got
an
error message which I corrected, in my experience MOPP2003 will not let
you
complete and save a custom field if there is an error in a formula.

I am off working with clients here in the UK Thursday and Friday so will
resume this thread either at the weekend or next Monday. Thanks for your
continued assistance.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
Let's see. First, you want to enable macros, otherwise the macro won't
run.

The #error appears to be related to the formulas. Did you use the
exact
custom field names that I specified? If not, the names in the
formulas
need
to be updated. Also, might want to double-check for all the
parentheses,
etc.

I think you are really close. Keep me posted.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


:

Hi TGG,

Many thanks for your continued input on this query.

Well I managed to set the Macro Security to low and re-started
MOPP2003.
I
opened the Ent Global and did ALT+F11 to display the Visual Basic
Window
Macro. It displayed the ThisProject(EnterpriseGlobal) node. I then
clicked
the View Code button which appears immediately above the
Project-VBAProject
window and in the pane on the right hand side pasted the script you
provided. I clicked the Save button and then ALT+Q to return to
MOPP2003.

When I next started up MOPP2003 I got the Security Warning dialogue
box
which I assume indicates that my Macro is present? If I am in a
session
of
MOPP2003 with Macros disabled and then open the Enterprise Global I
get
the
security warning and once in the Ent Global if I go ALT+F11 I can see
the
script for the Macro displayed in the pane on the right hand side.

However I do not appear to be getting this Macro to perform as
expected.
When I open a project plan and display the "Phase" table I have
created
the
Phase Flag field says No by default and the Phase Date and Current
Phase
columns display #ERROR in all rows. Changing a flag on a Milestone to
Yes
clears the #ERROR values from all non-milestone unflagged tasks,
however
summary tasks still show #ERROR and the Current Phase column shows no
values
or #ERROR at all. Do the Summary Task and corresponding Milestone need
to
have exactly the same text value?

I assume there is a simple answer to this which I am missing due to a
lack
of Macro knowledge and hope you can help.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Dominic,

I neglected to mention that macro security must be set to either
Medium
or
Low. Sorry about that. I prefer Medium since that provides the
user
with
a
measure of control when opening unfamilar project plans.

In Project Pro, go to Tools, Macro, Macro Security and set
appropriately.
You may also want to restart Project as a prudent measure.

I'm assuming you know how to get the macros into the macro editor,
yes?
If
not, press Alt+F11 in Project Pro to bring up the VB editor. The
"ThisProject" entry under VBAProject([name of open project]),
Microsoft
Project Objects should be selected in the left pane. Open it if it
is
not
already open. Paste in the code. Save the project. You should be
good
to
go. If this doesn't help, let me know.

Thanks!
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop
new Project 12 blog: http://blogs.msdn.com/dieterz/


:

TGG,

That was a really useful answer as I have been trying to figure out
how
to
do this for a while now. I have followed your instructions but have
to
admit
I am not "comfortable" with Macros.

I have documented my actions in following your instructions from
the
custom
Flag field through to the Date field - I am assuming that these
should
use
Enterprise Task Flag, Text and Date fields in the Enterprise
Global, I
have
also created a new table to display these fields. I have tried to
create
a
Macro using your posted content in the Enterprise Global but am
having
problems, can I ask you to provide an idiots step by step guide as
to
how
to
complete this?

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Try this. We did something similar using milestones (Feasibility
Phase
milestone, etc.) and whether or not they were completed to denote
current
phase. We also wanted the info to show up in a PWA Project
Center
view
so
that the person could export via Excel 2003. So, it had to be in
the
Project
Summary task. This has not been fully tested, so your mileage
may
vary.
Please use it as a demo to give you other ideas.

Here's the steps for setup.

1. Customize a Flag field to denote which milestones you want to
evaluate.
For purposes of illustration, use Flag1 to do this. Then mark
the
milestones
to evaluate.

2. Customize Date2 to use the following formula and to rollup
the
Maximum
value.
IIf([Flag1]=Yes And [Finish]>DateValue([Current Date]) And [%
Complete]<>100
And [% Complete]>0,ProjDateValue([Finish]),ProjDateValue('NA'))
This
puts
the finish date of the current phase milestone into this field.

3. Customize Text 1 with the following formula:
IIf(ProjDateValue([Date2])<>ProjDateValue('NA') And
[Summary]=No,[Name],"")
This retrieves the name description of the current phase
milestone.

4. Lastly, add the following macro code to move the Text 1 value
to
the
Project Summary rollup. You can't rollup text values for some
reasons
without this.

Private Sub Project_BeforeSave(ByVal pj As MSProject.Project)

Dim t As Task
On Error GoTo ErrorHandler

Application.CalculateAll

For Each t In ActiveProject.Tasks
If t.Text1 <> "" Then
SetTaskField Field:="Text1", Value:=t.Text1, TaskID:="0"
End If
Next t

GoTo EndSub

ErrorHandler:

MsgBox Prompt:="Error Number: " & Err.Number,
Buttons:=vbCritical, _
Title:="Set of Milestone To Summary Level Macro Error"

EndSub:
End Sub

If you autopublish, the values will get published to PWA
automatically.
Otherwise, you have to remember to publish.

I hope this helps.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


:

Dan,

Does the "Current Phase" value calculate correctly in Microsoft
Project
itself? I have been trying to design the same feature myself and
my
postings
drew a blank. If the value in MS Project calculates correctly
you
are
closer
to resolution than I am.

To test the value is correct you could create a new table that
includes
the
Enterprise Project Text field, it will show the same value
against
every
task in your project plan. If it is delivering the correct value
then
check
how your Project Centre view is defined - Enterprise Project
fields
can
be
used in these views whereas Enterprise Task fields will display
in
a
Project
View.

I hope this is of some assistance, please let me know how you
get
on.

Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
message
Greetings All

I am relatively new to Project Server and are attempting to
use a
Enterprise
Project Text field (which I have renamed Current Phase) to
hold a
value
which
indicates the phase of the project. I have implemented a
Enterprise
Task
Flag
that indicates whether a Task is completed, based on the %
complete
field.
I
have then tried to use that flag inconjunction with the Task
name
to
calculate the current phase and store that in 'Current Phase'.
I
have
Opened,
re-calculated and re-published a project, but the 'Current
phase'
field
is
blank when view in a custom view on PWA.
 
D

Dominic Moss

Attempts to send you an e-mail result in failure, no e-mail received from
you - can you respond to this Newsgroup or as suggested contact me by the
method previously suggested?

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
I sent you an email from my Yahoo account with an additional request.
Hopefully, you received it. If not, let me know.

Thanks!
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop

Dominic Moss said:
Thanks for the latest nudge in the right direction.

I first off defined the Enterprise Task Fields with new names. When
defining
the formulas I used the custom names for the fields but noted that
MOPP2003
automatically corrects this with the default name of the field in [ ]
brackets. I copied the formulas as you posted them, in one instance I got
an
error message which I corrected, in my experience MOPP2003 will not let
you
complete and save a custom field if there is an error in a formula.

I am off working with clients here in the UK Thursday and Friday so will
resume this thread either at the weekend or next Monday. Thanks for your
continued assistance.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
TGG said:
Let's see. First, you want to enable macros, otherwise the macro won't
run.

The #error appears to be related to the formulas. Did you use the
exact
custom field names that I specified? If not, the names in the
formulas
need
to be updated. Also, might want to double-check for all the
parentheses,
etc.

I think you are really close. Keep me posted.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


:

Hi TGG,

Many thanks for your continued input on this query.

Well I managed to set the Macro Security to low and re-started
MOPP2003.
I
opened the Ent Global and did ALT+F11 to display the Visual Basic
Window
Macro. It displayed the ThisProject(EnterpriseGlobal) node. I then
clicked
the View Code button which appears immediately above the
Project-VBAProject
window and in the pane on the right hand side pasted the script you
provided. I clicked the Save button and then ALT+Q to return to
MOPP2003.

When I next started up MOPP2003 I got the Security Warning dialogue
box
which I assume indicates that my Macro is present? If I am in a
session
of
MOPP2003 with Macros disabled and then open the Enterprise Global I
get
the
security warning and once in the Ent Global if I go ALT+F11 I can see
the
script for the Macro displayed in the pane on the right hand side.

However I do not appear to be getting this Macro to perform as
expected.
When I open a project plan and display the "Phase" table I have
created
the
Phase Flag field says No by default and the Phase Date and Current
Phase
columns display #ERROR in all rows. Changing a flag on a Milestone to
Yes
clears the #ERROR values from all non-milestone unflagged tasks,
however
summary tasks still show #ERROR and the Current Phase column shows no
values
or #ERROR at all. Do the Summary Task and corresponding Milestone need
to
have exactly the same text value?

I assume there is a simple answer to this which I am missing due to a
lack
of Macro knowledge and hope you can help.

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Dominic,

I neglected to mention that macro security must be set to either
Medium
or
Low. Sorry about that. I prefer Medium since that provides the
user
with
a
measure of control when opening unfamilar project plans.

In Project Pro, go to Tools, Macro, Macro Security and set
appropriately.
You may also want to restart Project as a prudent measure.

I'm assuming you know how to get the macros into the macro editor,
yes?
If
not, press Alt+F11 in Project Pro to bring up the VB editor. The
"ThisProject" entry under VBAProject([name of open project]),
Microsoft
Project Objects should be selected in the left pane. Open it if it
is
not
already open. Paste in the code. Save the project. You should be
good
to
go. If this doesn't help, let me know.

Thanks!
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop
new Project 12 blog: http://blogs.msdn.com/dieterz/


:

TGG,

That was a really useful answer as I have been trying to figure out
how
to
do this for a while now. I have followed your instructions but have
to
admit
I am not "comfortable" with Macros.

I have documented my actions in following your instructions from
the
custom
Flag field through to the Date field - I am assuming that these
should
use
Enterprise Task Flag, Text and Date fields in the Enterprise
Global, I
have
also created a new table to display these fields. I have tried to
create
a
Macro using your posted content in the Enterprise Global but am
having
problems, can I ask you to provide an idiots step by step guide as
to
how
to
complete this?

--
Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
Try this. We did something similar using milestones (Feasibility
Phase
milestone, etc.) and whether or not they were completed to denote
current
phase. We also wanted the info to show up in a PWA Project
Center
view
so
that the person could export via Excel 2003. So, it had to be in
the
Project
Summary task. This has not been fully tested, so your mileage
may
vary.
Please use it as a demo to give you other ideas.

Here's the steps for setup.

1. Customize a Flag field to denote which milestones you want to
evaluate.
For purposes of illustration, use Flag1 to do this. Then mark
the
milestones
to evaluate.

2. Customize Date2 to use the following formula and to rollup
the
Maximum
value.
IIf([Flag1]=Yes And [Finish]>DateValue([Current Date]) And [%
Complete]<>100
And [% Complete]>0,ProjDateValue([Finish]),ProjDateValue('NA'))
This
puts
the finish date of the current phase milestone into this field.

3. Customize Text 1 with the following formula:
IIf(ProjDateValue([Date2])<>ProjDateValue('NA') And
[Summary]=No,[Name],"")
This retrieves the name description of the current phase
milestone.

4. Lastly, add the following macro code to move the Text 1 value
to
the
Project Summary rollup. You can't rollup text values for some
reasons
without this.

Private Sub Project_BeforeSave(ByVal pj As MSProject.Project)

Dim t As Task
On Error GoTo ErrorHandler

Application.CalculateAll

For Each t In ActiveProject.Tasks
If t.Text1 <> "" Then
SetTaskField Field:="Text1", Value:=t.Text1, TaskID:="0"
End If
Next t

GoTo EndSub

ErrorHandler:

MsgBox Prompt:="Error Number: " & Err.Number,
Buttons:=vbCritical, _
Title:="Set of Milestone To Summary Level Macro Error"

EndSub:
End Sub

If you autopublish, the values will get published to PWA
automatically.
Otherwise, you have to remember to publish.

I hope this helps.
TGG

blog: http://spaces.msn.com/members/evildoctorporkchop


:

Dan,

Does the "Current Phase" value calculate correctly in Microsoft
Project
itself? I have been trying to design the same feature myself and
my
postings
drew a blank. If the value in MS Project calculates correctly
you
are
closer
to resolution than I am.

To test the value is correct you could create a new table that
includes
the
Enterprise Project Text field, it will show the same value
against
every
task in your project plan. If it is delivering the correct value
then
check
how your Project Centre view is defined - Enterprise Project
fields
can
be
used in these views whereas Enterprise Task fields will display
in
a
Project
View.

I hope this is of some assistance, please let me know how you
get
on.

Dominic Moss

www.projectability.co.uk

Helping people achieve more with Microsoft Project

Tel +44 8707 303 400
Fax +44 8707 303 500
message
Greetings All

I am relatively new to Project Server and are attempting to
use a
Enterprise
Project Text field (which I have renamed Current Phase) to
hold a
value
which
indicates the phase of the project. I have implemented a
Enterprise
Task
Flag
that indicates whether a Task is completed, based on the %
complete
field.
I
have then tried to use that flag inconjunction with the Task
name
to
calculate the current phase and store that in 'Current Phase'.
I
have
Opened,
re-calculated and re-published a project, but the 'Current
phase'
field
is
blank when view in a custom view on PWA.
 
D

Dale

I am trying to accomplish much the same thing and have read these replies but
it seems that things were left hanging. Can anyone help refresh the
procedure to accomplish this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top