Programming the duration

A

Andrew

Hi,

I have been searching all over the internet to see whether it is
possible to program either via a macro or VB script the duration into
MS project. For several tasks I calculate the start date through the
use of predecessors and I could also calculate the stop date using a
predecessor but MSP does not have this functionality to do both start
and stop dates.

I wanted to get around this by automatically populating the duration
with the difference between to dates. Does anyone know if this is
possible?

Many Thanks,

Andrew
 
D

Dave

I'm afraid I don't understand your question. Project will calculate the
duration for you based on the duration of all of your tasks and their
relationships and the degree of concurrency that can be achieved between
non-linked tasks.

Intuitively you can't program the duration as it is something that is
dependent on the way the Project is executed (if you want to program the
duration and get Project to arrange the tasks so they are executed
within that duration, then you can't).

Dave
 
J

Jan De Messemaeker

Hi,

Simply put: yes.
In VBA the function to use is Application.Datedifference
HTH
 
A

Andrew

Let me try to explain a little further what it is I am attempting.

I have a series of milestone events in my project plan. For a couple of
the tasks I have there are no fixed durations and they are dependent on
when the milestones occur.

So for example task 2 would have a predecessor of task 1 which would
give me a start date and the stop date for task 2 would be one of the
milestones. To my knowledge you cannot have a defined start stop date
and a constrained stop date. You need to use the duration to give you
the stop date.

Now I can manually type the duration but if the milestone changes (and
it often does) then so to does the duration. I want to have the process
automated where the duration is programmed as the difference between
task 2's start date and the milestone date.

Any thoughts?
 
D

Dave

Link task 1 to task 2 FS and make a dynamic link for the end date for
task 2 by copying and 'paste special link' from the milestone date?

Dave
 
A

Andrew

Good idea but the duration overrides the pasted link so the stop date
is still controlled by the duration
 
D

Dave

Then unlinking Task 1 from Task 2 and 'special' pasting a link to the
end date of task 1 into the start date of Task 2 as well as doing the
same with the milestone appears to work.

Now of course your network diagram isn't strictly correct, but this
appears to give you what you want (I think somebody else in fact
suggested a hammock task earlier in this thread, although this isn't
strictly hammocking in the normal sense of the word).

Dave
 
A

Andrew

Excellent, that works a treat, thanks Dave.

I would still be interested to know whether it is possible to program
the duration though using VB?
 
D

Dave

It clearly could be. One approach could be to have a macro that was
called every time a flagged milestone was moved which would then edit
the predecessor tasks.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top