There is probably a basic answer to my question, however I don't have the programming background to find it and have been trying to figure it out for a day now.
Here goes.
I'm writing a macro that will place Tasks in the network diagram (in Microsoft Project) in specific locations (so the user can create and see visually dependencies of smaller groups of tasks). The macro calls an excel file which has three columns of information. The excel file contains the UniqueID, XPosition, and YPosition.
My problem occurs when my macro tries to place a task that has already been deleted (in Microsoft Project), and the excel file still contains a reference to the Unique ID of the deleted task. When the macro tries to place the task that does not exist anymore, the code dies (as would be expected).
I need a way to check if that Unique ID still exists and if not just skip it(maybe provide user with a warning).
This is the line of code that gives me trouble. UniqueIDNum() is an array read from excel.
I thought of using something like an ON Error Resume, but I'm not entirely sure how to implement it.
Hope this is clear enough to understand.
Thoughts?
Here goes.
I'm writing a macro that will place Tasks in the network diagram (in Microsoft Project) in specific locations (so the user can create and see visually dependencies of smaller groups of tasks). The macro calls an excel file which has three columns of information. The excel file contains the UniqueID, XPosition, and YPosition.
My problem occurs when my macro tries to place a task that has already been deleted (in Microsoft Project), and the excel file still contains a reference to the Unique ID of the deleted task. When the macro tries to place the task that does not exist anymore, the code dies (as would be expected).
I need a way to check if that Unique ID still exists and if not just skip it(maybe provide user with a warning).
Code:
Set jTask = ActiveProject.Tasks.UniqueID(UniqueIDNum(I))
This is the line of code that gives me trouble. UniqueIDNum() is an array read from excel.
I thought of using something like an ON Error Resume, but I'm not entirely sure how to implement it.
Hope this is clear enough to understand.
Thoughts?