27 September 2010 15:20
How do I create a macro for more than one pre-desseour dependencies? in MS project 2010?
27 September 2010 21:21Moderator
Create the dependencies one-by-one using the method:
Task.TaskDependencies.Add (From, Type, Lag)
I hope this helps,
My EPM blog: Projectopolis
28 September 2010 10:50Moderator
Further to Hans's response, the easiest way is to set up a suitable schedule, start recording a macro and then set the predecessor's you want. Once finished, stop the macro and review the code.
www.epmsource.com | Twitter
Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page
28 September 2010 12:54Moderator
Although this works in theory, very often it generates rather unusable code because it is fully concentrating on the selection of cells. OTOH nearly all code in VBA is written based on Task, Resources, Assignment objects and not on selections. To me, recording a macro is really the final ressort. Hans' suggestion is way better than what a macro recorder will generate:
' Macro Macro4
' Macro Recorded 28/09/10
SelectTaskField Row:=-6, Column:="Name"
SelectTaskField Row:=3, Column:="Name", Add:=True
SelectTaskField Row:=-2, Column:="Name"
SelectTaskField Row:=2, Column:="Name", Add:=True
Maybe you will now agree with my description as "unusable"
28 September 2010 12:56Moderator
Since you unmarked Hans' post as answer could you specify more clearly what exactly you want?
29 September 2010 3:08
I need to make the following value in the field of Predecessor work:
to have multiple dependencies to the same task like 10SS and 10FF.
29 September 2010 5:53Moderator
You can NOT have multiple dependencies between two tasks. What you are asking for is not possible with or without VBA.
The closest you can come is by pasting links from one task start to the other, and from the task finish to another (look up "hammock task" for a description of this technique. I do not recommend that practice either as it is a bit fragile, I do not know that there are any VBA methods for the creation of those sorts of links either.
Sorry, but you can not do what you want with Project.
Think about some other way of achieving the same objective (perhaps a shared start milestone?)
Jack Dahlgren blogs at:
Project and Retrovention
and rarely Twitter
- Ditandai sebagai Jawaban oleh Gary Chefetz, MCITP, MCT, MVPModerator 29 September 2010 16:40