Changing Lags

G

glen.e.mettler

Using 2003
I am evaluating a project that has lots of large lags - FS & SS
I need to reduce the overall project duration by 10%.
I have reduced all of the critical path and near critical path tasks by

10%.
However, the lags are posing a problem with final reviews and delivery
dates because the lag is hard coded. This is especially true of the SS

lags.

I have created a macro to reduce lags by 10% for labs > 20 days but it
doesn't work.


Sub changelag()
NumTasks = ActiveProject.Tasks.Count
For t = 1 To NumTasks
If Not ActiveProject.Tasks(t).Summary Then
If ActiveProject.Tasks(t).PercentComplete Then
Else
predcount =
ActiveProject.Tasks(t).PredecessorTasks.Count
For pc = 1 To predcount
preduniqueid =
ActiveProject.Tasks(t).PredecessorTasks.Item(pc)
curlag =
(ActiveProject.Tasks(t).TaskDependencies(pc).Lag) / 480
If curlag > 20 Then
curlag = Int(curlag * 0.9)
'IT CRASHES ON THE NEXT LINE
ActiveProject.Tasks(t).TaskDependencies(pc).Lag
= curlag
End If
Next pc
End If
End If
Next t
End Sub

Any thoughts/fixes?


Glen
 
J

John

Using 2003
I am evaluating a project that has lots of large lags - FS & SS
I need to reduce the overall project duration by 10%.
I have reduced all of the critical path and near critical path tasks by

10%.
However, the lags are posing a problem with final reviews and delivery
dates because the lag is hard coded. This is especially true of the SS

lags.

I have created a macro to reduce lags by 10% for labs > 20 days but it
doesn't work.


Sub changelag()
NumTasks = ActiveProject.Tasks.Count
For t = 1 To NumTasks
If Not ActiveProject.Tasks(t).Summary Then
If ActiveProject.Tasks(t).PercentComplete Then
Else
predcount =
ActiveProject.Tasks(t).PredecessorTasks.Count
For pc = 1 To predcount
preduniqueid =
ActiveProject.Tasks(t).PredecessorTasks.Item(pc)
curlag =
(ActiveProject.Tasks(t).TaskDependencies(pc).Lag) / 480
If curlag > 20 Then
curlag = Int(curlag * 0.9)
'IT CRASHES ON THE NEXT LINE
ActiveProject.Tasks(t).TaskDependencies(pc).Lag
= curlag
End If
Next pc
End If
End If
Next t
End Sub

Any thoughts/fixes?


Glen

Glen,
The basic problem is that the curlag variable needs to be a string.
Beyond, that, here is a more compact macro that should do what you need.
Sub lagfixer()
Dim t As Task
Dim d As TaskDependency
For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
If t.Summary = False Then
For Each d In t.TaskDependencies
If (d.Lag / 480) > 20 Then d.Lag = CStr(d.Lag / 480 *
0.9)
Next d
End If
End If
Next t
End Sub

Hope this helps.
John
Project MVP
 
G

glen.e.mettler

John,
Very good. I will now make it a little more sophisticated by including
a user form to capture the % of reduction, the task durations to
include and a radio button to include/exclude in-progress tasks.

Thank you!
Glen
 
J

John

John,
Very good. I will now make it a little more sophisticated by including
a user form to capture the % of reduction, the task durations to
include and a radio button to include/exclude in-progress tasks.

Thank you!
Glen

Go for it Glen! Go for it!

You're welcome and thanks for the feedback

John
 

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