Unanswered 2007: Change Highlighting and VBA

  • 25/رمضان/1432 06:05 م
     
     

    Is there a way to sort of wrap a transaction around a group of changes in a project VBA macro so that the change highlighting reflects everything that changed within?  If you just iterate through the Tasks collection and modify fields, only the last task you change will be highlighted.  But for example if you change the project start date, or reschedule remaining work, project highlights all affected tasks from that one operation.


    Terrie T - MCTS - PMP - MBA****PMO & Project Server Admin

جميع الردود

  • 25/رمضان/1432 08:15 م
     
     

    Terrie,

    Hmmmm, "wrap a transaction", that's pretty encompassing. So, let me see if I understand what you are trying to do. You are making changes via VBA and you want to visually highlight the field cell of each change. Is that right? Assuming it is, you can change the font color of the field cell with each change but that won't pick up collateral changes. So maybe highlight the whole row, but again, that won't pick up collateral changes in the network. Tough order to fill.

    But here's a plan. make all your changes and then run the Compare Projects utility. It will show all changes between the old and new version. Several years ago I wrote a project compare macro (prior to Microsoft releasing their version). The output of my macro is a highlighted version wherein all changes are both annotated in an extra field and highlighted with font color. Sounds a lot like what you want.

    John

  • 26/جمادى الأولى/1433 09:27 م
     
     

    Terrie,

       I think you can use some of the new undo methods described in http://msdn.microsoft.com/en-us/library/ms477952(v=office.12).aspx .  The page includes several examples that seem to address your specific question.

    -Norman

  • 27/جمادى الأولى/1433 02:37 م
     
     

    Thanks Norman, I had already employed the Open/Close Undo Transaction feature and it works as expected, but it doesn't impact the change highlighting. Only the changes from the last macro action are highlighted, rather than ALL of the items affected by actions in the macro.


    Terrie T - MCTS - PMP - MBA****PMO & Project Server Admin

  • 28/جمادى الأولى/1433 07:21 ص
    المشرف
     
     

    The only way I can think of is to mark every task you change as Marked (activeproject.tasks(1).changed)

    Then use Text Styles to show marked tasks differently. This won't however catch every cell that gets recalculated. To do so in VBA would be rather slow when looping thru hundreds of tasks.


    Rod Gill

    The one and only Project VBA Book Rod Gill Project Management

  • 28/جمادى الأولى/1433 02:03 م
     
     

    You could always use one of the baselines - set it at the start of each sesssion, and use that to track your differences?

    You could then set up a filter for tasks that don't match their baseline start/finish/duration/work:

    And apply highlighting based on that filter:

    Unfortunately, it highlights the entire row, not just the cell, but it's quite nicely automated for you and doesn't require VBA.