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.
 

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