Result property
Gets or sets a cell's value.
Version added
2.0
Syntax
| |
| |
retVal |
Double. The value in the cell. |
object |
Required. An expression that returns a Cell object. |
unitsNameOrCode |
Required Variant. The units to use when retrieving or setting the cell's value. |
newValue |
Required Double. The new value for the cell. |
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, then 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("in") where "in" can also be any of the alternate strings representing inches, such as "inch", "in.", or "i".
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.