none
Setting Early/Late Start/Finish for activities using C# RRS feed

  • Question

  • I'm really new at this, so this might be trivial. I'm developing an add-in for MS Project 2010 using C# (VS2010).

    I created my own add-in tab and placed some buttons that will be used to schedule activities using some different algorithms.

    So basically I need to change early and late start times, as well as early and late finish times, for all the activities of my project.

    The thing is, when I try to set the

    project.Tasks.get_UniqueID(1).EarlyStart = DateTime.Now;
     

    VS tells me that I cant set it because it is read only.

    Can anyone help me please?


    Saturday, June 30, 2012 2:22 AM

Answers

  • Hi,

    Early and Late dates are calculated by Project from dependencies and constraints. For tasks that are not linked to other tasks you could set early start by the constraint type Start No earlier than, and the constraint date; then add a deadline for the late finish. But if the task is linked to other tasks these can be recalcualated by Proijec!

    As a matter of principle, you cannot do by programming what you cannot do manually. Project is a tool that calculates dates!

    Greetings,

    • Marked as answer by Andre Guedes Saturday, June 30, 2012 3:10 PM
    Saturday, June 30, 2012 8:48 AM
    Moderator

All replies

  • Hi,

    Early and Late dates are calculated by Project from dependencies and constraints. For tasks that are not linked to other tasks you could set early start by the constraint type Start No earlier than, and the constraint date; then add a deadline for the late finish. But if the task is linked to other tasks these can be recalcualated by Proijec!

    As a matter of principle, you cannot do by programming what you cannot do manually. Project is a tool that calculates dates!

    Greetings,

    • Marked as answer by Andre Guedes Saturday, June 30, 2012 3:10 PM
    Saturday, June 30, 2012 8:48 AM
    Moderator
  • Hi Jan,

    Thanks for your answer. Just let me ask one more thing. How about the 24hour calendar? How can I set the project calendar to 24 hour with C#?

    Thanks in advance.

    Regards,

    André

    Saturday, June 30, 2012 3:11 PM
  • Hi,

    I do not code C#, but AFAIK it uses the same objects as VBA; this is how it is done in VBA:

    ProjectSummaryInfo Calendar:="24 Hours"

    Hope you can add all the extra stuff C# requires.

    Greetings,

    Saturday, June 30, 2012 6:25 PM
    Moderator