Table of Contents

Class Cell

Namespace
FileFormat.Cells
Assembly
FileFormat.Cells.dll
public sealed class Cell
Inheritance
Cell
Inherited Members

Constructors

Cell(Cell, SheetData, WorkbookPart)

Initializes a new instance of the Cell class.

public Cell(Cell cell, SheetData sheetData, WorkbookPart workbookPart)

Parameters

cell Cell

The underlying OpenXML cell object.

sheetData SheetData

The sheet data containing the cell.

workbookPart WorkbookPart

Exceptions

ArgumentNullException

Thrown when cell or sheetData is null.

Properties

CellReference

Gets the cell reference in A1 notation.

public string CellReference { get; }

Property Value

string

Methods

ApplyStyle(uint)

Applies a style to the cell.

public void ApplyStyle(uint styleIndex)

Parameters

styleIndex uint

The index of the style to apply.

GetDataType()

Gets the data type of the cell's value.

public CellValues? GetDataType()

Returns

CellValues?

The cell's value data type, or null if not set.

GetFormula()

Gets the formula set for the cell.

public string GetFormula()

Returns

string

The cell's formula as a string, or null if not set.

GetValue()

Gets the value of the cell.

public string GetValue()

Returns

string

The cell value as a string.

PutFormula(string)

Sets a formula for the cell.

public void PutFormula(string formula)

Parameters

formula string

The formula to set.

PutValue(DateTime)

Sets the value of the cell as a date.

public void PutValue(DateTime value)

Parameters

value DateTime

The date value to set.

PutValue(double)

Sets the value of the cell as a number.

public void PutValue(double value)

Parameters

value double

The numeric value to set.

PutValue(string)

Sets the value of the cell as a string.

public void PutValue(string value)

Parameters

value string

The value to set.