Condividi tramite


XmlMappedRange.FormulaLocal Property

Definition

Gets or sets the formula for the XmlMappedRange control, using A1-style references in the language of the user.

public:
 property System::Object ^ FormulaLocal { System::Object ^ get(); void set(System::Object ^ value); };
public object FormulaLocal { get; set; }
member this.FormulaLocal : obj with get, set
Public Property FormulaLocal As Object

Property Value

The formula for the XmlMappedRange control, using A1-style references in the language of the user.

Examples

The following code example uses the FormulaLocal property to set the value of an XmlMappedRange to equal the sum of the values of cells A1 and A2. The formula is localized according to the language of the system it is run on. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerAddress1Cell with a corresponding schema element of type int.

private void SetFormulaLocal()
{
    this.Range["A1", "A2"].Value2 = 2222;
    this.CustomerAddress1Cell.FormulaLocal = "=Sum(A1+A2)";
}
Private Sub SetFormulaLocal()
    Me.Range("A1", "A2").Value2 = 2222
    Me.CustomerAddress1Cell.FormulaLocal = "=Sum(A1+A2)"
End Sub

Remarks

If the XmlMappedRange control contains a constant, this property returns that constant.

If the XmlMappedRange control is empty, the property returns an empty string.

If the XmlMappedRange control contains a formula, the property returns the formula as a string, in the same format in which it would be displayed in the formula bar (including the equal sign).

If you set the value or formula of an XmlMappedRange control to a date, Microsoft Office Excel checks to see whether that cell is already formatted with one of the date or time number formats. If not, the number format is changed to the default short date number format.

Applies to