Project.CurrentDate property (Project)
Gets or sets the current date for a project. Read/write Variant.
Syntax
expression. CurrentDate
expression A variable that represents a Project object.
Remarks
When a project opens, Project automatically sets the project's current date equal to the system date.
Example
The following example sets the current date of the active project to the previous Monday.
Sub SetCurrentDateToPreviousMonday()
' Loop while the current date is not Monday.
Do While WeekDay(ActiveProject.CurrentDate) <> pjMonday
' Subtract one day from the current date.
ActiveProject.CurrentDate = _
DateSerial(Year(ActiveProject.CurrentDate), _
Month(ActiveProject.CurrentDate), _
Day(ActiveProject.CurrentDate - 1))
Loop
End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.