TaskDependency.From property (Project)

Gets a Task object that is the predecessor in a task dependency. Read-only Task.

Syntax

expression. From

expression A variable that represents a TaskDependency object.

Example

In the following example, the From property appears to get both a Task object and a Long value. However, because UniqueID is the default property of a Task object, the second assignment using the From property is equivalent to the statement, taskId = ActiveProject.Tasks(2).TaskDependencies(i).From.UniqueID.

Sub TestDependenciesFrom() 
 Dim tsk As Task 
 Dim numDependencies As Integer 
 Dim taskId As Long 
 Dim i As Integer 
 
 numDependencies = ActiveProject.Tasks(2).TaskDependencies.Count 
 
 For i = 1 To numDependencies 
 Set tsk = ActiveProject.Tasks(2).TaskDependencies(i).From 
 Debug.Print tsk.Name 
 
 taskId = ActiveProject.Tasks(2).TaskDependencies(i).From 
 Debug.Print taskId 
 Next i 
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.