Represents a cell in a Microsoft Excel worksheet.

Hierarchy

Hierarchy

Implements

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get associatedDataTable(): WorksheetDataTable
  • Gets the data table to which the cell belongs.

    The cells in the left-most column and top-most row of the data table will return null for the associated data table.

    If a data table is associated with the cell, getting the value will return the calculated value for the cell.

    Note: it is slightly faster to use the WorksheetRow.getCellAssociatedDataTable method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellAssociatedDataTable method.

    The data table to which the cell belongs or null if the cell does not belong to a data table.

    See

    Returns WorksheetDataTable

  • get associatedTable(): WorksheetTable
  • Gets the WorksheetTable to which this cell belongs.

    A cell belongs to a table if it exists in any area of the table. It can be a header cell, total cell, or a cell in the data area.

    Note: it is slightly faster to use the WorksheetRow.getCellAssociatedTable method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellAssociatedTable method.

    See

    Returns WorksheetTable

  • get cellFormat(): IWorksheetCellFormat
  • Gets the cell formatting for this cell.

    Use this property to set cell formatting specific to the cell. If you will be applying the format to numerous cells, see the Workbook.createNewWorksheetCellFormat method for performance considerations.

    If this cell belongs to a merged cell region, getting the CellFormat will get the CellFormat of the associated merged cell region.

    Note: it is slightly faster to use the WorksheetRow.getCellFormat method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellFormat method.

    The cell formatting for this cell.

    See

    Returns IWorksheetCellFormat

  • get columnIndex(): number
  • Gets the column index of the cell. The column index of the cell.

    Returns number

  • get hasCellFormat(): boolean
  • Gets the value which indicates whether the cell's format has been initialized yet.

    See

    cellFormat

    Returns boolean

  • get hasComment(): boolean
  • Get the value indicating whether the cell has an associated comment.

    Note: it is slightly faster to use the WorksheetRow.getCellComment method and check for a non null return value, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellComment method and checking for a non null return value.

    True if the cell has an associated comment; False otherwise.

    See

    Returns boolean

  • get rowIndex(): number
  • Gets the row index of the cell. The row index of the cell.

    Returns number

  • get value(): any
  • Gets or sets the value of the cell.

    If this cell belongs to a merged cell region and it is the top-left cell of the region, getting and setting the value will get and set the value of the associated merged cell region. Getting the value of other cells in a merged cell region will always return null. Setting the value of other cells in a merged cell region will have no effect.

    If a formula has been applied to the cell or a data table is associated with the cell, getting the Value will return the calculated value of the cell.

    The types supported for the value are:

    • System.Byte
    • System.SByte
    • System.Int16
    • System.Int64
    • System.UInt16
    • System.UInt64
    • System.UInt32
    • System.Int32
    • System.Single
    • System.Double
    • System.Boolean
    • System.Char
    • System.Enum
    • System.Decimal
    • System.DateTime
    • System.String
    • System.Text.StringBuilder
    • System.DBNull
    • ErrorValue
    • FormattedString

    Note: it is slightly faster to use the WorksheetRow.getCellValue or WorksheetRow.setCellValue methods, which do not create WorksheetCell instances internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetCellComment or WorksheetRow.SetCellComment methods.

    The value of the cell.

    Throws

    NotSupportedException The assigned value's type is not supported and can't be exported to Excel.

    Throws

    InvalidOperationException The value assigned is a formula. Instead, Formula.applyTo should be called on the Formula, passing in the cell.

    Throws

    InvalidOperationException The value assigned is a WorksheetDataTable. Instead, the WorksheetDataTable.cellsInTable should be set to a region containing the cell.

    Throws

    InvalidOperationException The value assigned is a FormattedString which is the value another cell or merged cell region.

    Throws

    InvalidOperationException The value is assigned and this cell is part of an ArrayFormula or WorksheetDataTable.

    See

    Returns any

  • set value(a: any): void
  • Parameters

    • a: any

    Returns void

  • get worksheet(): Worksheet
  • Gets the worksheet to which the cell belongs. The worksheet to which the cell belongs.

    Returns Worksheet

Methods

  • Applies a formula to the cell.

    'value' is parsed based on the CellReferenceMode of the Workbook to which the cell belongs. If the cell's worksheet has been removed from its parent collection, the A1 CellReferenceMode will be used to parse the formula.

    Note: it is slightly faster to use the WorksheetRow.applyCellFormula method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this method is equivalent to using the WorksheetRow.ApplyCellFormula method.

    Throws

    ArgumentNullException 'value' is null or empty.

    Throws

    FormulaParseException 'value' is not a valid formula.

    Throws

    InvalidOperationException The cell is part of an array formula or data table which is not confined to just the cell.

    See

    Parameters

    • value: string

      The formula to parse and apply to the cell.

    Returns void

  • Removes the comment associated with the cell.

    Note: it is slightly faster to use the WorksheetRow.setCellComment method and pass in null as the comment parameter, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this method is equivalent to using the WorksheetRow.SetCellComment method and passing in null as the comment parameter.

    See

    Returns void

  • Determines whether the specified object is another WorksheetCell instance which refers to the same location on the same worksheet as this cell.

    Returns

    True if the cells refer to the same location on the same worksheet; False otherwise.

    Parameters

    • obj: any

      The instance to check for equality.

    Returns boolean

  • Gets the bounds of the cell in twips (1/20th of a point).

    The bounds returned by this method are only valid with the current configuration of the worksheet. If any rows or columns before the cell are resized, these bounds will no longer reflect the position of the cell.

    Note: it is slightly faster to use the WorksheetRow.getCellBoundsInTwips method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this method is equivalent to using the WorksheetRow.GetBoundsInTwips method.

    Returns

    The bounds of the cell on its worksheet.

    See

    WorksheetRow.getCellBoundsInTwips

    Returns IgRect

  • Gets the bounds of the cell in twips (1/20th of a point).

    The bounds returned by this method are only valid with the current configuration of the worksheet. If any rows or columns before the cell are resized, these bounds will no longer reflect the position of the cell.

    Note: it is slightly faster to use the WorksheetRow.getCellBoundsInTwips method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this method is equivalent to using the WorksheetRow.GetBoundsInTwips method.

    Returns

    The bounds of the cell on its worksheet.

    See

    WorksheetRow.getCellBoundsInTwips

    Parameters

    Returns IgRect

  • Gets the hash code of the WorksheetCell.

    Returns

    The hash code of the WorksheetCell.

    Returns number

  • Gets the resolved cell formatting for this cell.

    If any cell format properties are the default values on the cell, the values from the owning row's cell format will be used. If those are default, then the values from the owning column's cell format will be used. Otherwise, the workbook default values will be used.

    Note: it is slightly faster to use the WorksheetRow.getResolvedCellFormat method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this method is equivalent to using the WorksheetRow.GetResolvedCellFormat method.

    Returns

    A format object describing the actual formatting that will be used when displayed this cell in Microsoft Excel.

    See

    Returns IWorksheetCellFormat

  • Gets the text displayed in the cell.

    The display text is based on the value of the cell and the format string applied to the cell.

    Note: it is slightly faster to use the WorksheetRow.getCellText method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetText method.

    See

    Returns string

  • Gets the text of the cell.

    The text is based on the value of the cell and the format string applied to the cell.

    Note: it is slightly faster to use the WorksheetRow.getCellText method, which does not create a WorksheetCell instance internally. However, if a reference to the WorksheetCell instance already exists, using this property is equivalent to using the WorksheetRow.GetText method.

    Throws

    InvalidEnumArgumentException 'textFormatMode' is not defined in the TextFormatMode enumeration.

    See

    Parameters

    • textFormatMode: TextFormatMode

      The format mode to use when getting the cell text.

    Returns string

  • Gets the string representation of the address of the cell.

    Returns

    The string representation of the address of the cell.

    Returns string

  • Gets the string representation of the address of the cell.

    Returns

    The string representation of the address of the cell.

    Parameters

    • cellReferenceMode: CellReferenceMode

      The mode used to generate cell references.

    • includeWorksheetName: boolean

      The value indicating whether to include the worksheet name in the cell address.

    Returns string

  • Gets the string representation of the address of the cell.

    Returns

    The string representation of the address of the cell.

    Parameters

    • cellReferenceMode: CellReferenceMode

      The mode used to generate cell references.

    • includeWorksheetName: boolean

      The value indicating whether to include the worksheet name in the cell address.

    • useRelativeColumn: boolean

      The value indicating whether to use a relative column address.

    • useRelativeRow: boolean

      The value indicating whether to use a relative row address.

    Returns string

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Gets the string representation of the address of the cell.

    Returns

    The string representation of the address of the cell.

    Parameters

    • worksheetRow: WorksheetRow

      The WorksheetRow of the cell.

    • columnIndex: number

      The index of the column of the cell.

    • cellReferenceMode: CellReferenceMode

      The mode used to generate cell references.

    • includeWorksheetName: boolean

      The value indicating whether to include the worksheet name in the cell address.

    Returns string

  • Gets the string representation of the address of the cell.

    Returns

    The string representation of the address of the cell.

    Parameters

    • worksheetRow: WorksheetRow

      The WorksheetRow of the cell.

    • columnIndex: number

      The index of the column of the cell.

    • cellReferenceMode: CellReferenceMode

      The mode used to generate cell references.

    • includeWorksheetName: boolean

      The value indicating whether to include the worksheet name in the cell address.

    • useRelativeColumn: boolean

      The value indicating whether to use a relative column address.

    • useRelativeRow: boolean

      The value indicating whether to use a relative row address.

    Returns string

  • Parameters

    • obj: any

    Returns number

  • Returns True if a particular type of value can be exported to excel.

    Throws

    ArgumentNullException 'cellType' is null.

    Returns

    True if the type is supported as a cell value, False otherwise.

    Parameters

    • cellType: Type

      The type to test.

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean