SpaceCamel said:
How do you reference a new task created with the insertRow method?
With ActiveProject.Tasks(tID)
I get undefined.
SpaceCamel,
Maybe it fails because there is no "InsertRow" Method in Project! There
is however a "RowInsert" Method
If a blank row is inserted (that's all you will get by using the
RowInsert Method), there is no Task object to reference. A better
approach would be to use the Add Method on a Task collection. For
example, the following line of code will add a new task named "Do
something" right before the existing Task ID 5. The new task will then
become Task ID 5 as all tasks below it are shifted down and renumbered.
ActiveProject.Tasks.Add "Do something", 5
Hope this helps.
John
Project MVP