Cell.Dependents Property

Visio Automation Reference

Returns an array of ShapeSheet cells that are dependent on a particular cell of a Microsoft Office Visio shape. Read-only.

Version Information
 Version Added:  Visio 2003

Syntax

expression.Dependents

expression   An expression that returns a Cell object.

Return Value
Cell()

Remarks

The Dependents property returns an array of the cells that recalculate their values when the formula or value of the parent Cell object changes.

Example

The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the Dependents property to display a list of cells that are dependent on the Width cell of a rectangle shape.

Visual Basic for Applications
  Public Sub Dependents_Example()
Dim acellDependentCells() As Visio.Cell
Dim vsoCell As Visio.Cell
Dim vsoShape As Visio.Shape
Dim intCounter As Integer

'Draw a rectangle on the active page.
Set vsoShape = ActivePage.DrawRectangle(1, 5, 5, 1)

'Get the array of cells dependent on the Width cell of the shape
acellDependentCells = vsoShape.Cells("Width").Dependents

'List the cell names and their associated formulas
For intCounter = LBound(acellDependentCells) To UBound(acellDependentCells)

    Set vsoCell = acellDependentCells(intCounter)
    Debug.Print vsoCell.Name & " has this formula: " & vsoCell.Formula

Next

End Sub

See Also