I think I understand what you want...
A formula for your status indicator will execute per the information
contained in each individual file and provide a calculated value for you.
Each file (including the master project) carries its own status date. So,
you need to ensure the status date is the same in all the project files.
Here is some code that will do it for you that I happen to have laying
around. The code would be executed from the Master Project level as the
active project.
Public Sub DriveDownStatusDate()
Dim result As VbMsgBoxResult
Dim statusdate As Date
If (ActiveProject.statusdate = "NA") Then
result = MsgBox("Status Date is N/A, no action will be taken.", vbOKOnly,
"No Status Date Set")
Exit Sub
End If
statusdate = ActiveProject.statusdate
result = vbNo 'set to safe state
If (Abs(DateDiff("d", Now(), ActiveProject.statusdate)) > 30) Then
result = MsgBox("Status Date appears unreasonable" + _
vbCrLf + "Today: " & Str(Now()) + vbCrLf + _
"Status Date: " & Str(ActiveProject.statusdate), vbInformation, "Status Date
Check")
End If
result = MsgBox("Status Date: " & ActiveProject.statusdate & vbCrLf & _
"Assign this status date (recursively) to all subprojects in the active
project?", _
vbQuestion + vbOKCancel, "Confirm Status Date Propogation")
If result = vbOK Then
Call DrillStatusDown(Application.ActiveProject, statusdate)
Debug.Print ("Drilldown Complete")
Else
MsgBox ("Action canceled by user")
End If
End Sub
Private Sub DrillStatusDown(ByRef mProject As Project, ByVal statusdate)
Dim sProject As Subproject
Dim bProject As Project
mProject.statusdate = statusdate
Debug.Print ("Arrived: " & mProject.Name & " " & mProject.Subprojects.Count)
If mProject.Subprojects.Count = 0 Then
'Base Case
Exit Sub
End If
Dim icounter As Integer
icounter = 0
For Each sProject In mProject.Subprojects
icounter = icounter + 1
Debug.Print ("Prior to Set: " & mProject.Name & " icounter=" & icounter)
Set bProject = sProject.SourceProject
Debug.Print ("Successful Set: " & bProject.Name)
bProject.statusdate = statusdate
Debug.Print ("Status Date Set: " & bProject.Name)
Call DrillStatusDown(bProject, statusdate) 'recursively push status date
Debug.Print ("Successful Return from: " & bProject.Name)
Next
End Sub
The Deug.Print statements can be removed.
--
If this post was helpful, please consider rating it.
Jim
It''s software; it''s not allowed to win.
Visit
http://project.mvps.org/ for FAQs and more information
about Microsoft Project