Cells[U] property
Returns a Cell object that represents a ShapeSheet cell.
Version added
2.0
Syntax
| |
objRet |
A Cell object that represents the requested cell. |
object |
Required. An expression that returns a Shape or Style object that owns the cell. |
stringExpression |
Required String. The name of a ShapeSheet cell. |
Remarks
Cells("somestring") does not raise an exception if "somestring" does not name an actual cell. Subsequent methods invoked on the returned object will fail. You can determine if a cell with the name "somestring" exists using the CellExists property.
The cells in a shape's User-Defined Cells and Custom Properties sections belong to rows whose names have been assigned by the user or a program. You can access cells in named rows using the Cells property.
For example, if "MyRowsName" is the name of a row in a shape's User-Defined Cells section, you can access the zero'th (value) cell in this row using this statement:
cellobj = shpobj.cells("User.MyRowsName")
You can access the prompt cell in MyRowsName using this statement:
cellobj = shpobj.cells("User.MyRowsName.Prompt")
Next, assume that MyRowsName is in the Custom Properties section instead of the User- Defined Cells section. You can access the zero'th (value) cell using this statement:
cellobj = shpobj.cells("Prop.MyRowsName")
You can access other cells in the row using this statement:
cellobj = shpobj.cells("Prop.MyRowsName.xxx")
where xxx is one of these properties: Label, Prompt, SortKey, Type, Format, Invisible, or Ask.
Note Beginning with Visio 2000, you can refer to Visio shapes, masters, styles, pages, rows, and layers using local and universal names. When a user names a shape, for example, the user is specifying a local name. Universal names are not visible through the user interface. As a developer, you can use universal names in a program when you don't want to change a name each time a solution is localized. Use the Cells property to get a Cell object using the cell's local name. Use the CellsU property to get a Cell object using the cell's universal name.