SetValue Method

The SetValue method binds a value to a symbolic name in the Worksheet object. The binding takes place at the top of the worksheet, and any subsequent rebinding in the worksheet will replace the value. If AutoRecalc is set in the Worksheet object, the worksheet will be recalculated in its entirety whenever SetValue is called. If AutoRecalc is off, the automation client must use the Recalculate method to force a recalculation.

Syntax

objMC.SetValue(Name As String, Value As Variant)

Element

Description

objMC

A Mathcad application object.

Name

The name of the variable to bind.

Value

The value of the variable. The value may be any numeric or string variant type, a SAFEARRAY of any numeric or string variant type, a reference to a value object, or VT_NULL to remove the variable.

Remarks

This method returns no meaningful result.

The SetValue method can fail if there is a problem binding the variable.

If you need to set individual elements of a matrix, use MatrixValue.SetElement.