API Reference
ExcelCell
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.
Returned or exposed by
- Method ExcelCell.Clear
- Method ExcelCell.Currency
- Method ExcelCell.Date
- Method ExcelCell.DateTime
- Method ExcelCell.DurationHours
- Method ExcelCell.Error
- Method ExcelCell.HeaderStyle
- Method ExcelCell.Integer
- Method ExcelCell.MutedText
- Method ExcelCell.Number
- Method ExcelCell.Percent
- Method ExcelCell.SetBold
- Method ExcelCell.SetBorder
- Method ExcelCell.SetFillColor
- Method ExcelCell.SetFontColor
- Method ExcelCell.SetFormula
- Method ExcelCell.SetItalic
- Method ExcelCell.SetNumberFormat
- Method ExcelCell.SetRichText
- Method ExcelCell.SetUnderline
- Method ExcelCell.SetValue
- Method ExcelCell.Success
- Method ExcelCell.Text
- Method ExcelCell.Time
- Method ExcelCell.Warning
- Property ExcelRange.FirstCell
- Method ExcelSheet.CellAt
Methods
public ExcelCell Clear(ExcelClearOptions options = All) #ExcelCellClears selected cell data and metadata.
Parameters
- options OfficeIMO.Excel.ExcelClearOptions = All
public ExcelCell Currency(Int32 decimals = 2, CultureInfo culture = null) #ExcelCellApplies a currency number format.
Parameters
- decimals System.Int32 = 2
- culture System.Globalization.CultureInfo = null
public ExcelCell Date(String pattern = "yyyy-mm-dd") #ExcelCellApplies a date number format.
Parameters
- pattern System.String = "yyyy-mm-dd"
public ExcelCell DateTime(String pattern = "yyyy-mm-dd hh:mm:ss") #ExcelCellApplies a date/time number format.
Parameters
- pattern System.String = "yyyy-mm-dd hh:mm:ss"
public String GetFormattedText(IFormatProvider provider = null) #StringGets formatted display text for the cell value.
Parameters
- provider System.IFormatProvider = null
public IReadOnlyList<ExcelRichTextRun> GetRichText() #IReadOnlyList<ExcelRichTextRun>Gets rich inline text runs from the cell.
GetValue``1() #Gets the cell value converted to the requested type.
public ExcelCell Integer() #ExcelCellApplies a whole-number format with thousands separators.
public ExcelCell Number(Int32 decimals = 2) #ExcelCellApplies a decimal number format.
Parameters
- decimals System.Int32 = 2
public ExcelCell Percent(Int32 decimals = 0) #ExcelCellApplies a percent number format.
Parameters
- decimals System.Int32 = 0
public ExcelCell SetBold(Boolean bold = true) #ExcelCellSets or clears bold font style.
Parameters
- bold System.Boolean = true
public ExcelCell SetBorder(BorderStyleValues style, String hexColor = null) #ExcelCellApplies a border style to the cell.
Parameters
- style DocumentFormat.OpenXml.Spreadsheet.BorderStyleValues
- hexColor System.String = null
public ExcelCell SetFillColor(String hexColor) #ExcelCellSets the fill color using a hex color value.
Parameters
- hexColor System.String
public ExcelCell SetFontColor(String hexColor) #ExcelCellSets the font color using a hex color value.
Parameters
- hexColor System.String
public ExcelCell SetFormula(String formula) #ExcelCellSets the cell formula.
Parameters
- formula System.String
public ExcelCell SetItalic(Boolean italic = true) #ExcelCellSets or clears italic font style.
Parameters
- italic System.Boolean = true
public ExcelCell SetNumberFormat(String numberFormat) #ExcelCellApplies a number format to the cell.
Parameters
- numberFormat System.String
public ExcelCell SetRichText(params ExcelRichTextRun[] runs) #ExcelCellReplaces the cell contents with rich inline text runs.
Parameters
- runs OfficeIMO.Excel.ExcelRichTextRun[]
public ExcelCell SetUnderline(Boolean underline = true) #ExcelCellSets or clears underline font style.
Parameters
- underline System.Boolean = true
public ExcelCell SetValue(Object value) #ExcelCellSets the cell value.
Parameters
- value System.Object
TryGetValue``1(``0@ value) #Tries to get the cell value converted to the requested type.
Parameters
- value ``0@
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public ExcelSheet Sheet { get; } #Gets the worksheet that owns the cell.