none
What effects the Milestone Column? RRS feed

  • Question

  • I have an add-in that is creating new tasks in a blank MS Project file from another application.  A problem that I am having is with setting the MS Project Task Milestone column to our Milestone flag.  For some clients, it works fine and for others it doesn't.  Most often it will change it from Yes to No.  

    I played around in MS Project and the only trigger to change the Milestone column I could find was if I set it to Yes with Duration 0 days and then I change the duration to 1+ days.  It will set Milestone to No at that time and No to all parent tasks as well.  Our add-in situation though does not fit this criteria and the milestone is the last field set on the task creation so the duration is not changed afterward.

    I am wondering what other triggers in MS Project affect the Milestone.  I have searched around online but haven't found any help.  What conditions cause it to change from Yes to No and No to Yes?

     

    Thanks!

     


    Cindy
    Tuesday, November 29, 2011 7:57 PM

All replies

  • Hi Cindy,

    What version of Microsoft Project are you using? And the add-in is a VSTO addin? Or a macro?

    Are you trying to set the Milestone flag for tasks that have a duration > 0 days?

    A milestone is a task with duration = 0 days.So any action that changes duration (direct or indirect) might trigger the milestone flag fro Yes to No. Have you tried to set Duration = 0 days in the addin intead of setting the milestone flag? This will automatically set the Milestone flag to Yes.

    I hope this helps,
    Hans


    My EPM blog: Projectopolis
    Tuesday, November 29, 2011 10:50 PM
    Moderator
  • setting duration to a non-zero value will always change milestone to equal No. But you can set it back to yes. You might have your code check to see if it is going to set a duration from 0 to non-zero and if it does AND it is a milestone in your other application, set the milestone flag back Yes again.
    Brian Kennemer – DeltaBahn Senior Architect
    endlessly obsessing about Project Server…so that you don’t have to.
    Blog | Twitter | LinkedIn
    Wednesday, November 30, 2011 12:56 AM
    Moderator
  • This is a VSTO Add-in.  The client has Project 14.0.5128.5000 (32 bit) and I have 14.0.6112.5000 (32-bit).  Apparently, she cannot update Office at this time.  I am not able to reproduce her problems in my version though.  I guess I am looking for a solution around whatever is the problem in her version or definite proof that it won't work unless she does an update. 

    I added logging to the Application_ProjectBeforeTaskChange2 event.  If the milestone or duration are changed on any task, it logs a message to a file.  

    Task A  Start 11/20/2011  Finish 11/27/2011 (so Duration>0)

    From her test, when we create Task A the log says "Task A Milestone set to True" and it never logs another change event for Task A.  However, the Task View in Project says Milestone=False and it sends Milestone=False back to our application for Task A.  So the True value didn't stick or something changed it and didn't fire the Application_ProjectBeforeTaskChange2 event again.

    I compared the log on her machine to the log on my machine, and the most noticeable thing that I see is that the Tasks that are switching on her from True in our system to False in MS Project have Duration = 0 (but Start and Finish are not 0 days apart as shown above).  On my computer, even the tasks that have nothing entered in Duration in MS Project, report 480 as their duration.

    I know that is confusing, but it seems like a bug in how the duration/milestone worked in the previous version of Project vs. the current version of Project.  The question is how to do I work around it and have it work in both versions or is that even possible?


    Cindy
    Wednesday, December 7, 2011 10:30 PM
  • I'm afraid I'm not surprised. I found a number of bugs in VSTO for Project, even to not being able to acces the name property for tasks sometimes. You'll just have to try for some work arounds. Try forcing teh milestone flag to false then back to true or set duration to 1d then back to 0d.

    In any case I recomend you always get your code working in VBA first then migrate.


    Rod Gill

    The one and only Project VBA Book Rod Gill Project Management
    Friday, December 9, 2011 9:28 PM
    Moderator