PDA

View Full Version : MS Project - VBA code to lookup precessors from an external file



tech123
07-21-2017, 01:57 AM
I am looking for some help to update task dependencies in MS Project. I have a master file and a source file and I am trying to write a code to lookup the value from the "predecessors" field based on the taskID and project ID from the from the source file. I am trying to do a lookup based on the below values:

1) Master File.mpp: (The predecessor filed in this file needs to be updated from the Source File)

TaskID
Project Name
Predecessors : To be filled based on the value in the "Source File".

2) Source File:

TaskID
Project Name
Predecessors : Includes links to both internal tasks and external projects. This value needs to be updated to the "Master File".

I am trying to update the "Predecessor" field in Master File based on the value in source file. The lookup needs to be done based on a combination of the Task ID and the ProjectID. Task ID is repeating in the source file as it has multiple projects listed and hence a comination of TaskID+project ID will give a unique value based on which I can lookup the Predecessor.

Can someone PLEASE advise if there is an easy way to do this?

Thanks for your help!

Regards,
Sam