Application.UpdateTasks method (Project)

Updates the selected tasks.

Syntax

expression. UpdateTasks( _PercentComplete_, _ActualDuration_, _RemainingDuration_, _ActualStart_, _ActualFinish_, _Notes_ )

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
PercentComplete Optional Variant The percent complete of the active tasks.
ActualDuration Optional Variant The actual duration of the selected tasks.
RemainingDuration Optional Variant The remaining duration of the selected tasks.
ActualStart Optional Variant The actual start date of the selected tasks.
ActualFinish Optional Variant The actual finish date of the selected tasks.
Notes Optional String Comments in the Notes field for the selected tasks. The value can be text only, not Rich Text Format (RTF) as in the Notes dialog box.

Return value

Boolean

Remarks

Using the UpdateTasks method without specifying any arguments displays the Update Tasks dialog box.

Example

The following example creates a task named "TestTask-1", updates the task to 50% complete, and then deletes the task.

Sub Update_Tasks() 
 
 'Activate Gantt Chart 
 ViewApply Name:="Gantt Chart" 
 
 'Create a task 
 RowInsert 
 SetTaskField Field:="Name", Value:="TestTask-1" 
 SetTaskField Field:="Duration", Value:="2" 
 
 'Update the percent complete of the new task. 
 UpdateTasks PercentComplete:="50" 
 
 'Delete the new task 
 ActiveProject.Tasks("TestTask-1").Delete 
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.