Share via


XmlMappedRange.FormulaArray Property

Gets or sets the array formula of an XmlMappedRange control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Syntax

'Declaration
Property FormulaArray As Object
Object FormulaArray { get; set; }

Property Value

Type: System.Object
The array formula of a XmlMappedRange control.

Remarks

This property gets (or can be set to) a single formula or an array.

If the XmlMappedRange control does not contain an array formula, this property returns nulla null reference (Nothing in Visual Basic).

If you use this property to enter an array formula, the formula must use the R1C1 reference style, not the A1 reference style.

Examples

The following code example uses the FormulaArray property to set the value of an XmlMappedRange to equal the sum of the array of cells A1 through A3. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerAddress1Cell with a corresponding schema element of type int.

Private Sub SetFormulaArray()
    Me.Range("A1", "A3").Value2 = 2222
    Me.CustomerAddress1Cell.FormulaArray = "=Sum(R1C1:R3C1)" 
End Sub
private void SetFormulaArray()
{
    this.Range["A1", "A3"].Value2 = 2222;
    this.CustomerAddress1Cell.FormulaArray = "=Sum(R1C1:R3C1)";
}

.NET Framework Security

See Also

Reference

XmlMappedRange Interface

Microsoft.Office.Tools.Excel Namespace