API Reference

Class

ExcelCell

Namespace OfficeIMO.Excel
Assembly OfficeIMO.Excel
Modifiers sealed

Lightweight object model wrapper for a single worksheet cell.

Inheritance

  • Object
  • ExcelCell

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Methods

public ExcelCell Clear(ExcelClearOptions options = All) #
Returns: ExcelCell

Clears selected cell data and metadata.

Parameters

options OfficeIMO.Excel.ExcelClearOptions = All optionalposition: 0
public ExcelCell Currency(Int32 decimals = 2, CultureInfo culture = null) #
Returns: ExcelCell

Applies a currency number format.

Parameters

decimals System.Int32 = 2 optionalposition: 0
culture System.Globalization.CultureInfo = null optionalposition: 1
public ExcelCell Date(String pattern = "yyyy-mm-dd") #
Returns: ExcelCell

Applies a date number format.

Parameters

pattern System.String = "yyyy-mm-dd" optionalposition: 0
public ExcelCell DateTime(String pattern = "yyyy-mm-dd hh:mm:ss") #
Returns: ExcelCell

Applies a date/time number format.

Parameters

pattern System.String = "yyyy-mm-dd hh:mm:ss" optionalposition: 0
public ExcelCell DurationHours() #
Returns: ExcelCell

Applies an elapsed-hours duration format.

public ExcelCell Error() #
Returns: ExcelCell

Applies an error status style.

public String GetFormattedText(IFormatProvider provider = null) #
Returns: String

Gets formatted display text for the cell value.

Parameters

provider System.IFormatProvider = null optionalposition: 0
public IReadOnlyList<ExcelRichTextRun> GetRichText() #
Returns: IReadOnlyList<ExcelRichTextRun>

Gets rich inline text runs from the cell.

public T GetValue<T>() #
Returns: T

Gets a typed snapshot of the cell value.

Type Parameters

T
GetValue``1() #

Gets the cell value converted to the requested type.

public ExcelCell HeaderStyle() #
Returns: ExcelCell

Applies a simple report header style.

public ExcelCell Integer() #
Returns: ExcelCell

Applies a whole-number format with thousands separators.

public ExcelCell MutedText() #
Returns: ExcelCell

Applies a muted text style.

public ExcelCell Number(Int32 decimals = 2) #
Returns: ExcelCell

Applies a decimal number format.

Parameters

decimals System.Int32 = 2 optionalposition: 0
public ExcelCell Percent(Int32 decimals = 0) #
Returns: ExcelCell

Applies a percent number format.

Parameters

decimals System.Int32 = 0 optionalposition: 0
public ExcelCell SetBold(Boolean bold = true) #
Returns: ExcelCell

Sets or clears bold font style.

Parameters

bold System.Boolean = true optionalposition: 0
public ExcelCell SetBorder(BorderStyleValues style, String hexColor = null) #
Returns: ExcelCell

Applies a border style to the cell.

Parameters

style DocumentFormat.OpenXml.Spreadsheet.BorderStyleValues requiredposition: 0
hexColor System.String = null optionalposition: 1
public ExcelCell SetFillColor(String hexColor) #
Returns: ExcelCell

Sets the fill color using a hex color value.

Parameters

hexColor System.String requiredposition: 0
public ExcelCell SetFontColor(String hexColor) #
Returns: ExcelCell

Sets the font color using a hex color value.

Parameters

hexColor System.String requiredposition: 0
public ExcelCell SetFormula(String formula) #
Returns: ExcelCell

Sets the cell formula.

Parameters

formula System.String requiredposition: 0
public ExcelCell SetItalic(Boolean italic = true) #
Returns: ExcelCell

Sets or clears italic font style.

Parameters

italic System.Boolean = true optionalposition: 0
public ExcelCell SetNumberFormat(String numberFormat) #
Returns: ExcelCell

Applies a number format to the cell.

Parameters

numberFormat System.String requiredposition: 0
public ExcelCell SetRichText(params ExcelRichTextRun[] runs) #
Returns: ExcelCell

Replaces the cell contents with rich inline text runs.

Parameters

runs OfficeIMO.Excel.ExcelRichTextRun[] requiredposition: 0
public ExcelCell SetUnderline(Boolean underline = true) #
Returns: ExcelCell

Sets or clears underline font style.

Parameters

underline System.Boolean = true optionalposition: 0
public ExcelCell SetValue(Object value) #
Returns: ExcelCell

Sets the cell value.

Parameters

value System.Object requiredposition: 0
public ExcelCell Success() #
Returns: ExcelCell

Applies a positive/success status style.

public ExcelCell Text() #
Returns: ExcelCell

Applies a text number format.

public ExcelCell Time() #
Returns: ExcelCell

Applies a time number format.

public Boolean TryGetValue<T>(out T value) #
Returns: Boolean

Type Parameters

T

Parameters

value T requiredposition: 0
TryGetValue``1(``0@ value) #

Tries to get the cell value converted to the requested type.

Parameters

value ``0@ required
public ExcelCell Warning() #
Returns: ExcelCell

Applies a warning status style.

Properties

public ExcelSheet Sheet { get; } #

Gets the worksheet that owns the cell.

public Int32 Row { get; } #

Gets the 1-based row index.

public Int32 Column { get; } #

Gets the 1-based column index.

public String Address { get; } #

Gets the A1 cell address.