返回一组依赖于 Microsoft Visio 形状的特定单元格的 ShapeSheet 单元格。 此为只读属性。
语法
表达式。家属
表达 返回 Cell 对象的表达式。
返回值
Cell ()
备注
Dependents 属性返回单元格数组,这些单元格在父 Cell 对象的公式或值发生更改时重新计算其值。
示例
以下 Microsoft Visual Basic for Applications (VBA) 宏显示如何使用 Dependents 属性来显示依赖于矩形形状的 Width 单元格的单元格列表。
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
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。