ActiveProject.Tasks.Add
-
Thursday, May 03, 2012 12:56 PM
Hello,
what are correct parameters for add function? I want to add new task named XXX on 2nd position. But this code makes error:
Dim MT As Task
Set MT = ActiveProject.Tasks.Add(Name = "XXX", Before = 2)when I do not fill Before parameter, it works correctly but put tast on the end. How can I put task on selected position?
All Replies
-
Thursday, May 03, 2012 2:14 PM
Hi There--
Please see if the below thread helps.
http://social.technet.microsoft.com/Forums/en-US/project2010custprog/thread/905e7780-8377-44f7-9d59-372119e0ba4aThanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
-
Thursday, May 03, 2012 3:35 PMModerator
You are missing two colons.
Try this instead:
Dim MT As Task
Set MT = ActiveProject.Tasks.Add(Name:= "XXX", Before:= 2)If you are going to name your parameters you have to have a := not just a =
Brian Kennemer - Project MVP
DeltaBahn Senior Architect
endlessly obsessing about Project Server…so that you don’t have to.
Blog | Twitter | LinkedIn- Proposed As Answer by Rod Gill MVPMVP, Moderator Thursday, May 03, 2012 9:13 PM