how to use Functions in Project, in VBA?

B

Bjørn Tore Hovda

Hi!
someone know how to use functions like "ProjDateDiff" in VBA-code?
cant sort this out! somebody knows?


- Bjørn Tore
 
J

JackD

Bjorn,

You use ProjDateDiff in custom formulas (for custom fields)
In VBA you use Application.DateDifference

Syntax:
expression.DateDifference(StartDate, FinishDate, Calendar)

Example:
Sub dates()
Dim t As Task
Set t = ActiveProject.Tasks(1)
MsgBox (Application.DateDifference(t.Start, t.Finish, Standard))
End Sub

Note that duration is in minutes.
 
Top