Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

Link several predecessors to a successor activity

$
0
0

Hi,

I wrote this macro to connect multiple predecessors to a successor. it uses also a form to catch the successor number.

for some reason, after I run this macro (it makes the connections) when I try to save the file, MS Project collapses and I need to restart it.

this is the macro:

Sub Add_succesors()

Dim t As Task
Dim succ_task
Dim succ_task_number As Double

On Error GoTo 10
Form_AddSuccs.Show
succ_task_number = Form_AddSuccs.TextBox1.Value 'get the successor number

Set succ_task = ActiveProject.Tasks(succ_task_number)

For Each t In ActiveSelection.Tasks
    If Not t.Summary Then
        t.LinkSuccessors Tasks:=succ_task, Link:=pjFinishToStart
    End If
Next

10:
End Sub

we are using Project 2010, Office 2010 and windows 7.

what am I doing wrong?


Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>