Hi,
I'm building an application in VBA, which would (among other
funcionalities) calculate the planned time within particular project
between two dates (inserted by user in excel's cells). Is there any
method in MS Project library to calculate this time value, because I
can't find one?
Thanks for any reply.
Carlos,
Just to expand upon Jan's reply there are two different ways to work
with date differences. Your post isn't clear about what you want.
Although your post is in an MS Project newsgroup, implying the dates are
related to a schedule in Project, you also mention Excel cells. Project
has an expanded method of working with dates compared with Excel. In
Project, the default for date differences is in working time which
considers weekends, holidays and other non-working time defined by the
project's calendar and/or the calendar of resources assigned to tasks in
Project. On the other hand, Excel date differences are strictly time
deltas based on 24 hour days, 365 days a year.
The Method offered in Jan's reply is for working time, the difference of
two dates in Project and the full syntax is:
Application.DateDifference(StartDate, FinishDate, Calendar)
However, if what you really want is a date difference in elapsed time,
then you want to use the DateDiff Function which is:
DateDiff(interval, date1, date2, [firstdayofweek, [firstweekofyear]])
Ok, so this is probably more information than you wanted but finding the
difference between two dates has more than one answer.
Hope this helps.
John
Project MVP