Doug Keely
New Member
- Joined
- Apr 15, 2010
- Messages
- 2
Can anyone help me with what I'm trying to do here. I want to have Project 2003 update some specific Predecessor metrics based on start dates in this and a previous task line. The code, i think explains it better than I'm doing. This code all works, except i cant figure out how to record a task reference and then recall that task in order to update its predecessor.
Sub calculateNewPreds()
Dim ts As Tasks
Dim t As Task
Set ts = ActiveProject.Tasks
For Each t In ts
If Not t Is Nothing Then
If t.Name = "Project Start" Then
ProjStartDate = t.Start
End If
If t.Name = "New Sub Project Start Date" Then
IDEDPCStart = t.Start
'myUIDPred = code here to get reference task information
PDiff = (Application.DateDifference(ProjStartDate, IDEDPCStart, ActiveProject.Calendar)) / 60 / 8
If PDiff > 0 Then
myPreddy = "1FS + " & CStr(PDiff)
' code here to apply to referenced task
End If
End If
End If
Next t
End Sub
Sub calculateNewPreds()
Dim ts As Tasks
Dim t As Task
Set ts = ActiveProject.Tasks
For Each t In ts
If Not t Is Nothing Then
If t.Name = "Project Start" Then
ProjStartDate = t.Start
End If
If t.Name = "New Sub Project Start Date" Then
IDEDPCStart = t.Start
'myUIDPred = code here to get reference task information
PDiff = (Application.DateDifference(ProjStartDate, IDEDPCStart, ActiveProject.Calendar)) / 60 / 8
If PDiff > 0 Then
myPreddy = "1FS + " & CStr(PDiff)
' code here to apply to referenced task
End If
End If
End If
Next t
End Sub