Option Explicit
Sub CheckPreds()
‘ This application cycles through a project and:
‘ Places data in the tasks Text15 to indicate the status of the task as done, underway or ready to start
‘ changes the font for the row to gray if the task is complete or if the task is inactive
‘ changes the font for the row to red if the task is on the critical path and is not complete or inactive
‘ Written by Mark Darby
‘ Updated on 8 May 2018
Dim proj As Project
Dim ts As Tasks ‘Active task selection
Dim tsk As Task
Dim tPred As Task
Dim tskCtr, ctr As Integer
Dim tskCount As Integer ‘ Count of the number of tasks in the project
Dim pCount As Integer ‘ Counts the number of predecessor tasks for any given task
Dim perComp As Double ‘ Percentage Complete for any given task
Dim pCompl As Integer ‘ Counts the number of complete tasks for any given task
Dim Ready As Boolean ‘ Flags the task as being ready to execute
Set proj = ActiveProject
OutlineShowAllTasks
FilterApply “All Tasks”
tskCount = ActiveProject.Tasks.Count
Debug.Print “Beginning Formatting Loop”
For tskCtr = 1 To tskCount
Set tsk = proj.Tasks(tskCtr)
SelectRow Row:=tskCtr, RowRelative:=False, Height:=0, Add:=False
Font Color:=pjBlack, Bold:=False
Font32Ex StrikeThrough:=False
If Not tsk.Active Then
Font Color:=pjGray, Bold:=False
Font32Ex StrikeThrough:=True
Else
If tsk.PercentComplete = “100” Then
Font Color:=pjGray, Bold:=False
Font32Ex StrikeThrough:=False
‘Else
‘ If tsk.Critical Then
‘ Font Color:=pjRed, Bold:=True
‘ Font32Ex StrikeThrough:=False
‘ End If ‘tsk.Cricital
End If ‘tsk.PercentageComplete = “100”
If tsk.Summary Then
Font Bold:=True
End If
End If ‘Not tsk.Active
Next tskCtr
Debug.Print “Beginning Task Statusing Loop”
For tskCtr = 1 To tskCount
Set tsk = proj.Tasks(tskCtr)
tsk.Text15 = “–”
If tsk Is Nothing Then
‘ do nothing on blank lines
Else
If tsk.Active Then
If Not tsk.PercentComplete = “100” Then
If Not tsk.Summary Then
If tsk.ActualStart <> “NA” Then
tsk.Text15 = “Underway”
Else
pCount = 0 ‘ total count
pCompl = 0 ‘ complete countFor Each tPred In tsk.PredecessorTasks
For Each tPred In tsk.PredecessorTasks
pCount = pCount + 1
If tPred.PercentComplete = “100” Then
pCompl = pCompl + 1
End If
Next tPred
If pCount = pCompl Then
tsk.Text15 = “Ready”
End If ‘PCount = pCompl
End If ‘tsk.ActualStart <> “NA”
End If ‘Not tsk.summary
End If ‘Not tsk.PercentComplete = “100”
Else
tsk.Text15 = “–”
End If ‘not tsk.active
End If ‘T is nothing
Next tskCtr
SelectTaskField Row:=1, Column:=”Name”, RowRelative:=False
Beep
End Sub
——————————–
BTW — I welcome any feedback on this….
I’ve written a VB script that tags each task based on whether the task is “ready to start” or “is underway”. You should be able to update this and send an email based on the “ready to start” tag. I execute the script weekly as I update my projects. I use MSP 2016 desktop Professional. No on-line and no server. I’d be happy to share…
Mark
Thanks Larry,
Kinda figured. Am grateful.
Mark
Hey Larry,
Thank you so much.. this worked. I’m definitely learning more and more about issues with shared resources. I seem to have some issue with the shared resource file every two to three months. I’ve heard that my use of a master project file makes this less stable. Is that your experience?
Hoping that this is something Microsoft addresses in patches or future upgrades. Would love to have Project on-line or Server available… but… I’m wishing in one hand and…
Thanks again… am ever so grateful.
Mark
Hi Larry,
I tried your recommended fix. But… nothing happens when I click Break Link. If I click on share resources again, the link remains. I am choosing the option to: “Open resource pool read-write so that you can make changes…”.
Mark
Thanks, Larry. That is the answer that I thought it was… just need to know for sure. Have a great weekend.
Mark
All,
I’ve worked through this and found that walking through the time phased data with VB will not work if your project shares resources. I don’t understand why, though. My workaround: save a copy of the file to another directory. Open the copy but decline to open the shared resources file. Then, once open, change the resources to use those that are local. A little time consuming… but if you’re creating a report spanning more than a project or two, you’ll still save time.
Mark
Okay — I deleted and re-created the task and that seems to work. Don’t necessarily understand why — but that understanding is a nice to have as long as it works. We’re working a very critical timeline as we’re having to move out of a data center — and are very resource constrained. This schedule HAS to work. I’m grateful for your help.
Hi Larry,
Thanks for the answer. I did have all the sub-projects open while leveling and all have a priority. I have assigned only one person to each task. Generally, that’s the way we operate, anyway. I went through the entire list of projects this morning and scrubbed the predecessors for each task. This still allowed a task to begin with the first few days have “0” labor hours. I’m not that experienced with project — but have never seen that before. Finally, I turned off leveling’s ability to create splits. That worked… I just don’t understand why.
Should I place the resources within the Master Schedule — or in a separate shared resources file?
Okay… I feel stupid. I had somehow, accidentally, turned auto-calc off.
Thanks a bunch…
Mark
Hi Larry,
I have no one assigned to the summary. I just created a brand new project file, and listed three tasks under a summary. The tasks total 6 hours… but the summary shows 0. I’m starting to believe I have an issue with my install of project.
Thanks,
Mark