Detailed question about comparison of 2 Microsoft Project files

Copper Contributor

Hi there,

 

I'm very clear on how to perform a comparison of two Microsoft Project files which share an ancestry (e.g. you've created a project, some changes occur over a month, and then you compare to your original). 

 

My question relates to comparison of two microsoft project files which do not share an ancestry.

 

The situation is that I am using some VBA code to programmatically create Microsoft project files based on various input data.   I would then like to compare versions of these however even if nothing has changed in the input data, Microsoft Project spits out a comparison report indicating the files are completely different (even though Task name, dates and Unique ID are all identical).

 

Does anybody know a way to achieve this comparison ?  Or does anybody know what field Microsoft Project uses to perform its comparison as I may be able to programmatically set it ?

6 Replies
schnerrific,
In order to compare two Project files some type of reference index is needed. In the case of the Compare Project utility the Unique ID is that reference.

A couple years before Microsoft developed the compare utility I wrote my own compare macro which used the Unique ID as the reference between the two files. However, unlike the Microsoft version which create a separate new file with the differences, my macro used the Marked field as an indicator in both files for added tasks, deleted tasks and tasks with changes. My macro also color coded all changes in both files for an easy, visible output format.

John

@John-project thanks for your answer, you clearly know your stuff so I'm keen to hear more! It's interesting that you say it is the 'Unique ID' which Microsoft uses as I have two files that appear to be identical (same Unique IDs, task names and dates) as I generated both of them from the same macro.  However unless I'm misunderstanding something, Microsoft's compare utility highlights them as being entirely different. i.e. shows all of the rows of file A with negative signs on the left, followed by all of the rows of file B with positive signs on the left.

 

If you can think of anything else I should be considering please let me know.

 

Would be very interested to know more about the macro you wrote as perhaps that is a path I need to go down.

I actually just realised that even though in the source files (file A and B) the Unique IDs are the same (number 1-400) when I displayed Unique ID in the comparison view it had the numbers going up to 800 so I'm not sure what to make of that...
I think I may have answered my own question for that last comment. I assume in the act of creating a comparison file (effectively a master project) it starts its Unique IDs from scratch thus leading to the ids going up to 800.

However I am still in the unique positions where if I take one of my files, slightly modify a date, and compare, the comparison report successfully shows it. Yet if I take my two 'seemingly identical' files generated from a macro, and slightly modify one, the comparison report thinks it is an entirely different Project and shows the whole file as being different. Help!
After some more googling, I'm starting to wonder if it is actually the GUID that is the factor. As I can see that column has different values in the two files. So I'll explore that to see if it helps.

@schnerrific

I've never tried to run a comparison on two files that were generated by code. By default they would not be "genetically" related which is the basis for comparison.

 

The original Compare Projects utility did use the Unique ID as the reference. However, it had some issues and it wasn't until (I believe) release of Project 2010 that the utility was finally "fixed". It is possible that it now uses the GUID as the reference, I don't know.

 

Since you are trying to compare two files generated by a macro you will most likely need to create your own unique reference so the files can be compared, and write your own compare macro like I did many years ago.

 

Good luck.

John