Hi there, I found a vba script to pull the names of predecessors and successors and put them into the TEXT1 and TEXT2 fields in MS project. It was working yesterday, but today it is not. I’m using Project 2013.
Sub PredecList() Dim Job As Task Dim Predec As Task Dim Lis As String For Each Job In ActiveProject.Tasks If Not Job Is Nothing Then Lis = "" For Each Predec In Job.PredecessorTasks If Not Len(Lis) = 0 Then Lis = Lis & "," End If Lis = Lis & Predec.Name Next Predec Job.Text1 = Lis End If Next Job End Sub Sub SuccList() Dim Job As Task Dim Succ As Task Dim Lis As String For Each Job In ActiveProject.Tasks If Not Job Is Nothing Then Lis = "" For Each Succ In Job.SuccessorTasks If Not Len(Lis) = 0 Then Lis = Lis & "," End If Lis = Lis & Succ.Name Next Succ Job.Text2 = Lis End If Next Job End Sub
I get this error: Run-time error ‘1101’: The argument value is not valid
Job.Text1 = Lis
If you can help at all, I would be so grateful!
Thanks
Teresa