'Declaration Public Sub ApplyCellFormula( _ ByVal columnIndex As Integer, _ ByVal formula As String, _ Optional ByVal cellReferenceMode As Nullable(Of CellReferenceMode) _ )
public void ApplyCellFormula( int columnIndex, string formula, Nullable<CellReferenceMode> cellReferenceMode )
Exception | Description |
---|---|
System.ArgumentOutOfRangeException | columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. |
System.ArgumentNullException | formula is null or empty. |
FormulaParseException | formula is not a valid formula. |
System.InvalidOperationException | The cell is part of an array formula or data table which is not confined to just the cell. |
System.ComponentModel.InvalidEnumArgumentException | cellReferenceMode is not defined in the CellReferenceMode enumeration. |
System.InvalidOperationException | If the row was removed from the worksheet. |
formula is parsed based on the CellReferenceMode of the Workbook to which the row belongs. If the row's Worksheet has been removed from its parent collection, the A1 CellReferenceMode will be used to parse the formula.
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2