This topic has not yet been rated - Rate this topic

Cell.Result Property (Visio)

Gets or sets a cell's value. Read/write.

Version Information

Version Added: Visio 2.0

Syntax

expression .Result(UnitsNameOrCode)

expression A variable that represents a Cell object.

Parameters

Name Required/Optional Data Type Description

UnitsNameOrCode

Required

Variant

The units to use when retrieving or setting the cell's value.

Return Value

Double

Remarks

Use the Result property to set the value of an unguarded cell. If the cell's formula is protected with the GUARD function, the formula is not changed and an error is generated. If the cell contains only a text string, zero (0) is returned. If the string is invalid, an error is generated.

You can specify UnitsNameOrCode as an integer or a string value. For example, the following statements all set UnitsNameOrCode to inches.

retVal = Cell.Result(visInches)

retVal = Cell.Result(65)

retVal = Cell.Result("in") where "in" can also be any of the alternate strings representing inches, such as "inch", "in.", or "intCounter".

For a complete list of valid unit strings along with corresponding Automation constants (integer values), see About Units of Measure.

Automation constants for representing units are declared by the Visio type library in member VisUnitCodes .

To specify internal units, pass a zero-length string (""). Internal units are inches for distance and radians for angles. To specify implicit units, you must use the Formula property.

Example

This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Result property.

 
Public Sub Result_Example() 
 
 Dim vsoShape As Visio.Shape 
 Dim vsoCell As Visio.Cell 
 Dim intLocalCenterX As Double 
 
 'Draw a rectangle. 
 Set vsoShape = ActivePage.DrawRectangle(1, 5, 5, 1) 
 
 Set vsoCell = vsoShape.Cells("LocPinX") 
 intLocalCenterX = vsoCell.Result("cm") 
 Debug.Print intLocalCenterX 
 
 'You can also use the constants defined by the Visio type library. 
 intLocalCenterX = vsoCell.Result(visInches) 
 Debug.Print intLocalCenterX 
 
End Sub 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.