I am trying an addin for MSProject to find if the predecessors are assigned to every task.
I am using an object in the loop to run for all the tasks in the project & the loop is as under to find how many tasks are not assigned the predecessors.
For Each tsk In projApp.ActiveProject.Tasks
If Not tsk Is Nothing Then 'Test for blank row
If Not tsk.Summary Then 'If not a Summary Task
If tsk.Predecessors = "" Then
NoPred = NoPred + 1
End If
End If
End If
Next tsk
The data in NoPred is transferred to the Textbox in the window form.
When you run the code for the 1st time the textbox in the for shows the number of Tasks not having predecessors correctly. Suppose there are 5 tasks without predecessors, the form clearly shows 5. But suppose I assign the predecessors to some of the tasks& when I run the code it again shows 5 only. however if I close the VSTO & rerun then it shows correctly.
However in project VBA this works fine.
Can anybody enlighten me on the issue.
Thanks in Advance.
Rameshchandra C Keni (PMP)