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 specific locations. The macro calls an excel file which has three columns of information. The excel file contains the UniqueID, XPosition, and YPosition.
My problem is if the task has been deleted from the project, and the excel file still contians a reference to that Unique ID. 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.
I was thinking of possibly using something like
to skip the error. I don't really want to skip the error, I'd rather just compare the unique IDs in the excel file to that in Microsoft Project, and if one has been deleted skip 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 specific locations. The macro calls an excel file which has three columns of information. The excel file contains the UniqueID, XPosition, and YPosition.
My problem is if the task has been deleted from the project, and the excel file still contians a reference to that Unique ID. 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.
I was thinking of possibly using something like
Code:
On Error Resume Next
to skip the error. I don't really want to skip the error, I'd rather just compare the unique IDs in the excel file to that in Microsoft Project, and if one has been deleted skip it.
Hope this is clear enough to understand.
Thoughts?