Forum Discussion

schnerrific's avatar
schnerrific
Copper Contributor
Nov 03, 2023

Detailed question about comparison of 2 Microsoft Project files

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 ?

10 Replies

  • bertwong1's avatar
    bertwong1
    Copper Contributor

    schnerrific I have a somehow different issue but still related to this topic. I am doing a comparison of 2 mpp file. however, I am using add-in. hopefully i can explain it in a way you can figure out what I'm doing.

     

    step1: I open an mpp file (let's call it A). thus showing the add-in in the process cause it's in the menu

    step 2, there is a button in the add-in that asked to select another mpp file (let's call it B) to compare with.

    step 3: I should be able to open the selected mpp(B) file and compare it the existing(A)

     

    the problem, if I call the function to open the mpp file B, it's not showing. I created a new instance of mpp in the process, but still it's not showing. can you help me make it work?

     

    thanks,

    Gilbert

    • John-project's avatar
      John-project
      Silver Contributor
      Gilbert,
      What exactly is the add-in you are trying to use? I suggest you contact whoever created the add-in to find out how it's supposed to work.

      The Compare Projects utility found under, Report > Project group > Compare Projects is not an add-in, it is included as part of the Project app.

      John
      • bertwong1's avatar
        bertwong1
        Copper Contributor
        I also created that add-in, I am using VB.net. Initially, the add-in performs different reports. Now, I was instructed to create something similar to Compare Projects.
  • John-project's avatar
    John-project
    Silver Contributor
    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
    • schnerrific's avatar
      schnerrific
      Copper Contributor

      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.

      • schnerrific's avatar
        schnerrific
        Copper Contributor
        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...

Resources