ResultFromInt property

Microsoft Visio Developer Reference

ResultFromInt property

   Example   

Sets the value of a cell to an integer value.

Version added

4.5

Syntax

object.ResultFromInt(unitsNameOrCode) = newValue

object

Required. An expression that returns a Cell object.

unitsNameOrCode

Required Variant. The units to use when setting the cell's value.

newValue

Required Long. The new value for the cell.

Remarks

Setting the ResultFromInt property is similar to setting a cell's Result property. The difference is that the ResultFromInt property accepts an integer for the value of the cell, whereas the Result property accepts a floating point number.

You can specify unitsNameOrCode as an integer or a string value. If the string is invalid, an error is generated. For example, the following statements all set unitsNameOrCode to inches.

Cell.ResultFromInt(visInches) = newValue

Cell.ResultFromInt(65) = newValue

Cell.ResultFromInt("in") = newValue 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.

If the cell's formula is protected with a GUARD function, use the ResultFromIntForce property.