API Index

namespace ClosedXML.Excel

Enums

enum XLFilterDynamicType

Values:

AboveAverage
BelowAverage
enum XLFilterType

Values:

Regular
Custom
TopBottom
Dynamic
DateTimeGrouping
enum XLTopBottomPart

Values:

Top
Bottom
enum XLTopBottomType

Values:

Items
Percent
enum XLDateTimeGrouping

Values:

Year
Month
Day
Hour
Minute
Second
enum XLConnector

Values:

And
Or
enum XLFilterOperator

Values:

Equal
NotEqual
GreaterThan
LessThan
EqualOrGreaterThan
EqualOrLessThan
enum XLError

A formula error.

Keep order of errors in same order as value returned by ERROR.TYPE, because it is used for comparison in some case (e.g. AutoFilter). Values are off by 1, so default produces a valid error.

Values:

NullValue

#NULL! - Intended to indicate when two areas are required to intersect, but do not.

The space is an intersection operator.

SUM(B1 C1) tries to intersect B1:B1 area and C1:C1 area, but since there are no intersecting cells, the result is #NULL.

DivisionByZero

#DIV/0! - Intended to indicate when any number (including zero) or any error code is divided by zero.

IncompatibleValue

#VALUE! - Intended to indicate when an incompatible type argument is passed to a function, or an incompatible type operand is used with an operator.

Passing a non-number text to a function that requires a number, trying to get an area from non-contiguous reference. Creating an area from different sheets Sheet1!A1:Sheet2!A2

CellReference

#REF! - a formula refers to a cell that’s not valid.

When unable to find a sheet or a cell.

NameNotRecognized

#NAME? - Intended to indicate when what looks like a name is used, but no such name has been defined.

Only for named ranges, not sheets.

TestRange*10 when the named range doesn’t exist will result in an error.

NumberInvalid

#NUM! - Intended to indicate when an argument to a function has a compatible type, but has a value that is outside the domain over which that function is defined.

This is known as a domain error.

ASIN(10) - the ASIN accepts only argument -1..1 (an output of SIN), so the resulting value is #NUM!.

NoValueAvailable

#N/A - Intended to indicate when a designated value is not available.

The value is used for extra cells of an array formula that is applied on an array of a smaller size that the array formula.

enum XLDataType

A value that is in the cell.

Values:

Blank

The value is a blank (either blank cells or the omitted optional argument of a function, e.g. IF(TRUE,,).

Keep as the first, so the default values are blank.

Boolean

The value is a logical value.

Number

The value is a double-precision floating points number, excluding Double.NaN, Double.PositiveInfinity or double.NegativeInfinity.

Text

A text or a rich text. Can’t be null and can be at most 32767 characters long.

Error

The value is one of XLError.

DateTime

The value is a DateTime, represented as a serial date time number.

Serial date time 60 is a 1900-02-29, nonexistent day kept for compatibility, but unrepresentable by DateTime. Don’t use.

TimeSpan

The value is a TimeSpan, represented in a serial date time (24 hours is 1, 36 hours is 1.5 ect.).

enum XLTableCellType

Values:

None
Header
Data
Total
enum XLCellCopyOptions

Values:

None
Values
Styles
ConditionalFormats
DataValidations
Sparklines
All
enum XLChartType

Values:

Area
Area3D
AreaStacked
AreaStacked100Percent
AreaStacked100Percent3D
AreaStacked3D
BarClustered
BarClustered3D
BarStacked
BarStacked100Percent
BarStacked100Percent3D
BarStacked3D
Bubble
Bubble3D
Column3D
ColumnClustered
ColumnClustered3D
ColumnStacked
ColumnStacked100Percent
ColumnStacked100Percent3D
ColumnStacked3D
Cone
ConeClustered
ConeHorizontalClustered
ConeHorizontalStacked
ConeHorizontalStacked100Percent
ConeStacked
ConeStacked100Percent
Cylinder
CylinderClustered
CylinderHorizontalClustered
CylinderHorizontalStacked
CylinderHorizontalStacked100Percent
CylinderStacked
CylinderStacked100Percent
Doughnut
DoughnutExploded
Line
Line3D
LineStacked
LineStacked100Percent
LineWithMarkers
LineWithMarkersStacked
LineWithMarkersStacked100Percent
Pie
Pie3D
PieExploded
PieExploded3D
PieToBar
PieToPie
Pyramid
PyramidClustered
PyramidHorizontalClustered
PyramidHorizontalStacked
PyramidHorizontalStacked100Percent
PyramidStacked
PyramidStacked100Percent
Radar
RadarFilled
RadarWithMarkers
StockHighLowClose
StockOpenHighLowClose
StockVolumeHighLowClose
StockVolumeOpenHighLowClose
Surface
SurfaceContour
SurfaceContourWireframe
SurfaceWireframe
XYScatterMarkers
XYScatterSmoothLinesNoMarkers
XYScatterSmoothLinesWithMarkers
XYScatterStraightLinesNoMarkers
XYScatterStraightLinesWithMarkers
enum XLChartTypeCategory

Values:

Bar3D
enum XLBarOrientation

Values:

Vertical
Horizontal
enum XLBarGrouping

Values:

Clustered
Percent
Stacked
Standard
enum XLCFContentType

Values:

Number
Percent
Formula
Percentile
Minimum
Maximum
enum XLCFIconSetOperator

Values:

GreaterThan
EqualOrGreaterThan
enum XLTimePeriod

Values:

Yesterday
Today
Tomorrow
InTheLast7Days
LastWeek
ThisWeek
NextWeek
LastMonth
ThisMonth
NextMonth
enum XLIconSetStyle

Values:

ThreeArrows
ThreeArrowsGray
ThreeFlags
ThreeTrafficLights1
ThreeTrafficLights2
ThreeSigns
ThreeSymbols
ThreeSymbols2
FourArrows
FourArrowsGray
FourRedToBlack
FourRating
FourTrafficLights
FiveArrows
FiveArrowsGray
FiveRating
FiveQuarters
enum XLConditionalFormatType

Values:

Expression
CellIs
ColorScale
DataBar
IconSet
Top10
IsUnique
IsDuplicate
ContainsText
NotContainsText
StartsWith
EndsWith
IsBlank
NotBlank
IsError
NotError
TimePeriod
AboveAverage
enum XLCFOperator

Values:

Equal
NotEqual
GreaterThan
LessThan
EqualOrGreaterThan
EqualOrLessThan
Between
NotBetween
Contains
NotContains
StartsWith
EndsWith
enum XLCustomPropertyType

Values:

Text
Number
Date
Boolean
enum XLAllowedValues

Values:

AnyValue
WholeNumber
Decimal
Date
Time
TextLength
List
Custom
enum XLErrorStyle

Values:

Stop
Warning
Information
enum XLOperator

Values:

EqualTo
NotEqualTo
GreaterThan
LessThan
EqualOrGreaterThan
EqualOrLessThan
Between
NotBetween
enum XLDrawingAnchor

Values:

MoveAndSizeWithCells
MoveWithCells
Absolute
enum XLDrawingTextDirection

Values:

Context
LeftToRight
RightToLeft
enum XLDrawingTextOrientation

Values:

LeftToRight
Vertical
BottomToTop
TopToBottom
enum XLDrawingHorizontalAlignment

Values:

Left
Justify
Center
Right
Distributed
enum XLDrawingVerticalAlignment

Values:

Top
Justify
Center
Bottom
Distributed
enum XLDashStyle

Values:

Solid
RoundDot
SquareDot
Dash
DashDot
LongDash
LongDashDot
LongDashDotDot
enum XLLineStyle

Values:

Single
ThinThin
ThinThick
ThickThin
ThickBetweenThin
enum XLOutlineSummaryVLocation

Values:

Top
Bottom
enum XLOutlineSummaryHLocation

Values:

Left
Right
enum XLSheetViewOptions

Values:

Normal
PageBreakPreview
PageLayout
enum XLWorksheetVisibility

Values:

Visible
Hidden
VeryHidden
enum XLNamedRangeScope

Values:

Worksheet
Workbook
enum XLHFMode

Values:

OddPagesOnly
OddAndEvenPages
Odd
enum XLHFPredefinedText

Values:

PageNumber
NumberOfPages
Date
Time
FullPath
Path
File
SheetName
enum XLHFOccurrence

Values:

AllPages
OddPages
EvenPages
FirstPage
enum XLPageOrientation

Values:

Default
Portrait
Landscape
enum XLPaperSize

Values:

LetterPaper
LetterSmallPaper
TabloidPaper
LedgerPaper
LegalPaper
StatementPaper
ExecutivePaper
A3Paper
A4Paper
A4SmallPaper
A5Paper
B4Paper
B5Paper
FolioPaper
QuartoPaper
StandardPaper
StandardPaper1
NotePaper
No9Envelope
No10Envelope
No11Envelope
No12Envelope
No14Envelope
CPaper
DPaper
EPaper
DlEnvelope
C5Envelope
C3Envelope
C4Envelope
C6Envelope
C65Envelope
B4Envelope
B5Envelope
B6Envelope
ItalyEnvelope
MonarchEnvelope
No634Envelope
UsStandardFanfold
GermanStandardFanfold
GermanLegalFanfold
IsoB4
JapaneseDoublePostcard
StandardPaper2
StandardPaper3
StandardPaper4
InviteEnvelope
LetterExtraPaper
LegalExtraPaper
TabloidExtraPaper
A4ExtraPaper
LetterTransversePaper
A4TransversePaper
LetterExtraTransversePaper
SuperaSuperaA4Paper
SuperbSuperbA3Paper
LetterPlusPaper
A4PlusPaper
A5TransversePaper
JisB5TransversePaper
A3ExtraPaper
A5ExtraPaper
IsoB5ExtraPaper
A2Paper
A3TransversePaper
A3ExtraTransversePaper
enum XLPageOrderValues

Values:

DownThenOver
OverThenDown
enum XLShowCommentsValues

Values:

None
AtEnd
AsDisplayed
enum XLPrintErrorValues

Values:

Blank
Dash
Displayed
NA
enum XLSubtotalFunction

Values:

Automatic
None
Sum
Count
Average
Minimum
Maximum
Product
CountNumbers
StandardDeviation
PopulationStandardDeviation
Variance
PopulationVariance
enum XLPivotLayout

Values:

Outline
Tabular
Compact
enum XLPivotTableTheme

Values:

None
PivotStyleDark1
PivotStyleDark10
PivotStyleDark11
PivotStyleDark12
PivotStyleDark13
PivotStyleDark14
PivotStyleDark15
PivotStyleDark16
PivotStyleDark17
PivotStyleDark18
PivotStyleDark19
PivotStyleDark2
PivotStyleDark20
PivotStyleDark21
PivotStyleDark22
PivotStyleDark23
PivotStyleDark24
PivotStyleDark25
PivotStyleDark26
PivotStyleDark27
PivotStyleDark28
PivotStyleDark3
PivotStyleDark4
PivotStyleDark5
PivotStyleDark6
PivotStyleDark7
PivotStyleDark8
PivotStyleDark9
PivotStyleLight1
PivotStyleLight10
PivotStyleLight11
PivotStyleLight12
PivotStyleLight13
PivotStyleLight14
PivotStyleLight15
PivotStyleLight16
PivotStyleLight17
PivotStyleLight18
PivotStyleLight19
PivotStyleLight2
PivotStyleLight20
PivotStyleLight21
PivotStyleLight22
PivotStyleLight23
PivotStyleLight24
PivotStyleLight25
PivotStyleLight26
PivotStyleLight27
PivotStyleLight28
PivotStyleLight3
PivotStyleLight4
PivotStyleLight5
PivotStyleLight6
PivotStyleLight7
PivotStyleLight8
PivotStyleLight9
PivotStyleMedium1
PivotStyleMedium10
PivotStyleMedium11
PivotStyleMedium12
PivotStyleMedium13
PivotStyleMedium14
PivotStyleMedium15
PivotStyleMedium16
PivotStyleMedium17
PivotStyleMedium18
PivotStyleMedium19
PivotStyleMedium2
PivotStyleMedium20
PivotStyleMedium21
PivotStyleMedium22
PivotStyleMedium23
PivotStyleMedium24
PivotStyleMedium25
PivotStyleMedium26
PivotStyleMedium27
PivotStyleMedium28
PivotStyleMedium3
PivotStyleMedium4
PivotStyleMedium5
PivotStyleMedium6
PivotStyleMedium7
PivotStyleMedium8
PivotStyleMedium9
enum XLPivotSortType

Values:

Default
Ascending
Descending
enum XLPivotSubtotals

Values:

DoNotShow
AtTop
AtBottom
enum XLFilterAreaOrder

Values:

DownThenOver
OverThenDown
enum XLItemsToRetain

Values:

Automatic
None
Max
enum XLPivotTableSourceType

Values:

Range
Table
enum XLPivotStyleFormatElement

Values:

None
Label
Data
All
enum XLPivotStyleFormatTarget

Values:

PivotTable
GrandTotal
Subtotal
Header
Label
Data
enum XLPivotSummary

Values:

Sum
Count
Average
Minimum
Maximum
Product
CountNumbers
StandardDeviation
PopulationStandardDeviation
Variance
PopulationVariance
enum XLPivotCalculation

Values:

Normal
DifferenceFrom
PercentageOf
PercentageDifferenceFrom
RunningTotal
PercentageOfRow
PercentageOfColumn
PercentageOfTotal
Index
enum XLPivotCalculationItem

Values:

Value
Previous
Next
enum XLPivotAreaValues

Values:

None
Normal
Data
All
Origin
Button
TopRight
TopEnd
enum XLSheetProtectionElements

Values:

None
AutoFilter
DeleteColumns
DeleteRows
EditObjects
EditScenarios
FormatCells
FormatColumns
FormatRows
InsertColumns
InsertRows
PivotTables
SelectLockedCells
SelectUnlockedCells
Sort
DeleteEverything
FormatEverything
InsertEverything
SelectEverything
Everything
enum XLWorkbookProtectionElements

Values:

None
Structure
Windows

The Windows option is available only in Excel 2007, Excel 2010, Excel for Mac 2011, and Excel 2016 for Mac. Select the Windows option if you want to prevent users from moving, resizing, or closing the workbook window, or hide/unhide windows.

Everything
enum XLShiftDeletedCells

Values:

ShiftCellsUp
ShiftCellsLeft
enum XLTransposeOptions

Values:

MoveCells
ReplaceCells
enum XLSearchContents

Values:

Values
Formulas
ValuesAndFormulas
enum XLScope

Values:

Workbook
Worksheet
enum XLSortOrder

Values:

Ascending
Descending
enum XLSortOrientation

Values:

TopToBottom
LeftToRight
enum XLRangeType

Values:

Range
Column
Row
RangeColumn
RangeRow
Table
Worksheet
enum XLPhoneticAlignment

Values:

Center
Distributed
Left
NoControl
enum XLPhoneticType

Values:

FullWidthKatakana
HalfWidthKatakana
Hiragana
NoConversion
enum XLDisplayBlanksAsValues

Values:

Interpolate
NotPlotted
Zero
enum XLSparklineAxisMinMax

Values:

Automatic
SameForAll
Custom
enum XLSparklineMarkers

Values:

None
HighPoint
LowPoint
FirstPoint
LastPoint
NegativePoints
Markers
All
enum XLSparklineType

Values:

Line
Column
Stacked
enum XLColorType

Values:

Color
Theme
Indexed
enum XLThemeColor

Values:

Background1
Text1
Background2
Text2
Accent1
Accent2
Accent3
Accent4
Accent5
Accent6
enum XLAlignmentReadingOrderValues

Values:

ContextDependent
LeftToRight
RightToLeft
enum XLAlignmentHorizontalValues

Values:

Center
CenterContinuous
Distributed
Fill
General
Justify
Left
Right
enum XLAlignmentVerticalValues

Values:

Bottom
Center
Distributed
Justify
Top
enum XLBorderStyleValues

Values:

DashDot
DashDotDot
Dashed
Dotted
Double
Hair
Medium
MediumDashDot
MediumDashDotDot
MediumDashed
None
SlantDashDot
Thick
Thin
enum XLFillPatternValues

Values:

DarkDown
DarkGray
DarkGrid
DarkHorizontal
DarkTrellis
DarkUp
DarkVertical
Gray0625
Gray125
LightDown
LightGray
LightGrid
LightHorizontal
LightTrellis
LightUp
LightVertical
MediumGray
None
Solid
enum XLFontUnderlineValues

Values:

Double
DoubleAccounting
None
Single
SingleAccounting
enum XLFontVerticalTextAlignmentValues

Values:

Baseline
Subscript
Superscript
enum XLFontFamilyNumberingValues

Values:

NotApplicable
Roman
Swiss
Modern
Script
Decorative
enum XLFontCharSet

Values:

Ansi

ASCII character set.

Default

System default character set.

Symbol

Symbol character set.

Mac

Characters used by Macintosh.

ShiftJIS

Japanese character set.

Hangul

Korean character set.

Hangeul

Another common spelling of the Korean character set.

Johab

Korean character set.

GB2312

Chinese character set used in mainland China.

ChineseBig5

Chinese character set used mostly in Hong Kong SAR and Taiwan.

Greek

Greek character set.

Turkish

Turkish character set.

Vietnamese

Vietnamese character set.

Hebrew

Hebrew character set.

Arabic

Arabic character set.

Baltic

Baltic character set.

Russian

Russian character set.

Thai

Thai character set.

EastEurope

Eastern European character set.

Oem

Extended ASCII character set used with disk operating system (DOS) and some Microsoft Windows fonts.

enum XLTotalsRowFunction

Values:

None
Sum
Minimum
Maximum
Average
Count
CountNumbers
StandardDeviation
Variance
Custom
enum XLCellsUsedOptions

Values:

None
NoConstraints
Contents
DataType
NormalFormats
ConditionalFormats
Comments
DataValidation
MergedRanges
Sparklines
AllFormats
AllContents
All
enum XLClearOptions

Values:

Contents
NormalFormats
ConditionalFormats
Comments
DataValidation
MergedRanges
Sparklines
AllFormats
AllContents
All
enum XLCalculateMode

Values:

Auto
AutoNoTable
Manual
Default
enum XLReferenceStyle

Values:

R1C1
A1
Default
enum XLCellSetValueBehavior

Values:

Smart

Analyze input string and convert value. For avoid analyzing use escape symbol ‘

Simple

Direct set value. If value has unsupported type - value will be stored as string returned by object.ToString()

class AbstractPivotFieldReference

Subclassed by PivotLabelFieldReference, PivotValueFieldReference

class Blank

A blank value. Used as a value of blank cells or as an optional argument for function calls.

Public Static Attributes

readonly Blank Value = new()

Represents the sole instance of the Blank class.

class ColorExtensions
class DateTimeExtensions
class ><TKey, TValue> DictionaryComparer : public IEqualityComparer< Dictionary< TKey, TValue>
class DictionaryExtensions
class DoubleExtensions
class DoubleValueExtensions
class EnumConverter
class ><T> EnumerableComparer : public IEqualityComparer< IEnumerable< T>
class EnumerableExtensions
class FontBaseExtensions
class IntegerExtensions
interface IXLAddress : public IEqualityComparer<IXLAddress>, public IEquatable<IXLAddress>

Reference to a single cell in a workbook. Reference can be absolute, relative or mixed. Reference can be with or without a worksheet.

Subclassed by XLAddress

Properties

IXLWorksheet Worksheet { get; set; }

Worksheet of the reference. Value is null for address without a worksheet.

interface IXLAddressable

A very lightweight interface for entities that have an address as a rectangular range.

Subclassed by IXLRangeBase

Properties

IXLRangeAddress RangeAddress { get; set; }

Gets an object with the boundaries of this range.

interface IXLAlignment : public IEquatable<IXLAlignment>

Subclassed by XLAlignment

Properties

XLAlignmentHorizontalValues Horizontal { get; set; }

Gets or sets the cell’s horizontal alignment.

XLAlignmentVerticalValues Vertical { get; set; }

Gets or sets the cell’s vertical alignment.

Int32 Indent { get; set; }

Gets or sets the cell’s text indentation.

Boolean JustifyLastLine { get; set; }

Gets or sets whether the cell’s last line is justified or not.

XLAlignmentReadingOrderValues ReadingOrder { get; set; }

Gets or sets the cell’s reading order.

Int32 RelativeIndent { get; set; }

Gets or sets the cell’s relative indent.

Boolean ShrinkToFit { get; set; }

Gets or sets whether the cell’s font size should decrease to fit the contents.

Int32 TextRotation { get; set; }

Gets or sets the cell’s text rotation.

Boolean WrapText { get; set; }

Gets or sets whether the cell’s text should wrap if it doesn’t fit.

Boolean TopToBottom { get; set; }

Gets or sets whether the cell’s text should be displayed from to to bottom

(as opposed to the normal left to right).

interface IXLAutoFilter

Subclassed by XLAutoFilter

interface IXLBaseCollection<TSingle, TMultiple> : public System::Collections::IEnumerable<TSingle>

Public Functions

TMultiple AddToNamed (String rangeName)

Creates a named range out of these ranges.

If the named range exists, it will add these ranges to that named range.

The default scope for the named range is Workbook.

Param rangeName

Name of the range.

TMultiple AddToNamed (String rangeName, XLScope scope)

Creates a named range out of these ranges.

If the named range exists, it will add these ranges to that named range.

Param rangeName

Name of the range.

Param scope

The scope for the named range.

TMultiple AddToNamed (String rangeName, XLScope scope, String comment)

Creates a named range out of these ranges.

If the named range exists, it will add these ranges to that named range.

Param rangeName

Name of the range.

Param scope

The scope for the named range.

Param comment

The comments for the named range.

IXLCells Cells ()

Returns the collection of cells.

IXLCells CellsUsed ()

Returns the collection of cells that have a value.

IXLCells CellsUsed (Boolean includeFormats)

Returns the collection of cells that have a value.

Param includeFormats

if set to true will return all cells with a value or a style different than the default.

TMultiple Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of these ranges.

Param clearOptions

Specify what you want to clear.

Properties

Object Value { get; set; }

Sets the cells’ value.

If the object is an IEnumerable ClosedXML will copy the collection’s data into a table starting from each cell.

If the object is a range ClosedXML will copy the range starting from each cell.

Setting the value to an object (not IEnumerable/range) will call the object’s ToString() method.

ClosedXML will try to translate it to the corresponding type, if it can’t then the value will be left as a string.

The object containing the value(s) to set.

interface IXLBorder : public IEquatable<IXLBorder>

Subclassed by XLBorder

interface IXLCell

Subclassed by XLCell

Public Functions

IXLCell AddToNamed (String rangeName)

Creates a named range out of this cell.

If the named range exists, it will add this range to that named range.

The default scope for the named range is Workbook.

Param rangeName

Name of the range.

IXLCell AddToNamed (String rangeName, XLScope scope)

Creates a named range out of this cell.

If the named range exists, it will add this range to that named range.

Param rangeName

Name of the range.

Param scope

The scope for the named range.

IXLCell AddToNamed (String rangeName, XLScope scope, String comment)

Creates a named range out of this cell.

If the named range exists, it will add this range to that named range.

Param rangeName

Name of the range.

Param scope

The scope for the named range.

Param comment

The comments for the named range.

IXLRange AsRange ()

Returns this cell as an IXLRange.

IXLCell Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of this cell.

Param clearOptions

Specify what you want to clear.

IXLCell CopyFrom (IXLRangeBase rangeBase)

Copy range content to an area of same size starting at the cell. Original content of cells is overwritten.

Param rangeBase

Range whose content to copy.

Return

This cell.

IXLComment CreateComment ()

Creates a new comment for the cell, replacing the existing one.

IXLDataValidation CreateDataValidation ()

Creates a new data validation rule for the cell, replacing the existing one.

Creates a new hyperlink replacing the existing one.

IXLRichText CreateRichText ()

Replaces a value of the cell with a newly created rich text object.

void Delete (XLShiftDeletedCells shiftDeleteCells)

Deletes the current cell and shifts the surrounding cells according to the shiftDeleteCells parameter.

Param shiftDeleteCells

How to shift the surrounding cells.

IXLComment GetComment ()

Returns the comment for the cell or create a new instance if there is no comment on the cell.

IXLDataValidation GetDataValidation ()

Returns a data validation rule assigned to the cell, if any, or creates a new instance of data validation rule if no rule exists.

Boolean GetBoolean ()

Gets the cell’s value as a Boolean.

Shortcut for Value.GetBoolean()

Throws InvalidCastException

If the value of the cell is not a logical.

Double GetDouble ()

Gets the cell’s value as a Boolean.

Shortcut for Value.GetNumber()

Throws InvalidCastException

If the value of the cell is not a number.

String GetText ()

Gets the cell’s value as a String.

Shortcut for Value.GetText(). Returned value is never null.

Throws InvalidCastException

If the value of the cell is not a text.

XLError GetError ()

Gets the cell’s value as a XLError.

Shortcut for Value.GetError()

Throws InvalidCastException

If the value of the cell is not an error.

DateTime GetDateTime ()

Gets the cell’s value as a DateTime.

Shortcut for Value.GetDateTime()

Throws InvalidCastException

If the value of the cell is not a DateTime.

TimeSpan GetTimeSpan ()

Gets the cell’s value as a TimeSpan.

Shortcut for Value.GetTimeSpan()

Throws InvalidCastException

If the value of the cell is not a TimeSpan.

Boolean TryGetValue<T> (out T value)

Try to get cell’s value converted to the T type.

Supported T types:

  • Boolean - uses a logic of XLCellValue.TryConvert(out Boolean)

  • Number (s/byte, u/short, u/int, u/long, float, double, or decimal)

    • uses a logic of XLCellValue.TryConvert(out Double, System.Globalization.CultureInfo) and succeeds, if the value fits into the target type.

  • String - sets the result to a text representation of a cell value (using current culture).

  • DateTime - uses a logic of XLCellValue.TryConvert(out DateTime)

  • TimeSpan - uses a logic of XLCellValue.TryConvert(out TimeSpan, System.Globalization.CultureInfo)

  • XLError - if the value is of type XLDataType.Error, it will return the value.

  • Enum - tries to parse a value to a member by comparing the text of a cell value and a member name.

If the T is a nullable value type and the value of cell is blank or empty string, return null value.

If the cell value can’t be determined because formula function is not implemented, the method always returns false.

Tparam T

The requested type into which will the value be converted.

Param value

Value to store the value.

Return

true if the value was converted and the result is in the value , false otherwise.

T GetValue<T> ()

Conversion logic is identical with TryGetValue<T>.

Tparam T

The requested type into which will the value be converted.

Throws InvalidCastException

If the value can’t be converted to the type of T

String GetString ()

Return cell’s value represented as a string. Doesn’t use cell’s formatting or style.

String GetFormattedString ()

Gets the cell’s value formatted depending on the cell’s data type and style.

Returns a hyperlink for the cell, if any, or creates a new instance is there is no hyperlink.

IXLRichText GetRichText ()

Returns the value of the cell if it formatted as a rich text.

IXLRange InsertData (IEnumerable data)

Inserts the IEnumerable data elements and returns the range it occupies.

Param data

The IEnumerable data.

IXLRange InsertData (IEnumerable data, Boolean transpose)

Inserts the IEnumerable data elements and returns the range it occupies.

Param data

The IEnumerable data.

Param transpose

if set to true the data will be transposed before inserting.

IXLRange InsertData (DataTable dataTable)

Inserts the data of a data table.

Param dataTable

The data table.

Return

The range occupied by the inserted data

IXLTable InsertTable<T> (IEnumerable<T> data)

Inserts the IEnumerable data elements as a table and returns it.

The new table will receive a generic name: Table#

Param data

The table data.

IXLTable InsertTable<T> (IEnumerable<T> data, Boolean createTable)

Inserts the IEnumerable data elements as a table and returns it.

The new table will receive a generic name: Table#

if set to false the table will be created in memory.

Param data

The table data.

Param createTable

if set to true it will create an Excel table.

IXLTable InsertTable<T> (IEnumerable<T> data, String tableName)

Creates an Excel table from the given IEnumerable data elements.

Param data

The table data.

Param tableName

Name of the table.

IXLTable InsertTable<T> (IEnumerable<T> data, String tableName, Boolean createTable)

Inserts the IEnumerable data elements as a table and returns it.

if set to false the table will be created in memory.

Param data

The table data.

Param tableName

Name of the table.

Param createTable

if set to true it will create an Excel table.

IXLTable InsertTable (DataTable data)

Inserts the DataTable data elements as a table and returns it.

The new table will receive a generic name: Table#

Param data

The table data.

IXLTable InsertTable (DataTable data, Boolean createTable)

Inserts the DataTable data elements as a table and returns it.

The new table will receive a generic name: Table#

if set to false the table will be created in memory.

Param data

The table data.

Param createTable

if set to true it will create an Excel table.

IXLTable InsertTable (DataTable data, String tableName)

Creates an Excel table from the given DataTable data elements.

Param data

The table data.

Param tableName

Name of the table.

IXLTable InsertTable (DataTable data, String tableName, Boolean createTable)

Inserts the DataTable data elements as a table and returns it.

if set to false the table will be created in memory.

Param data

The table data.

Param tableName

Name of the table.

Param createTable

if set to true it will create an Excel table.

void InvalidateFormula ()

Invalidate CachedValue so the formula will be re-evaluated next time Value is accessed. If cell does not contain formula nothing happens.

IXLCell SetValue (XLCellValue value)
Return

This cell.

string ToString (string format)

Returns a string that represents the current state of the cell according to the format.

Param format

A: address, F: formula, NF: number format, BG: background color, FG: foreground color, V: formatted value

Properties

IXLAddress Address { get; set; }

Gets this cell’s address, relative to the worksheet.

The cell’s address.

XLCellValue CachedValue { get; set; }

Get the value of a cell without evaluation of a formula. If the cell contains a formula, it returns the last calculated value or a blank value. If the cell doesn’t contain a formula, it returns same value as Value. May hold invalid value when NeedsRecalculation flag is True.

Can be useful to decrease a number of formula evaluations.

IXLRange CurrentRegion { get; set; }

Returns the current region. The current region is a range bounded by any combination of blank rows and blank columns

The current region.

XLDataType DataType { get; set; }

Gets the type of this cell’s data.

The type of the cell’s data.

String FormulaA1 { get; set; }

Gets or sets the cell’s formula with A1 references.

The formula with A1 references.

String FormulaR1C1 { get; set; }

Gets or sets the cell’s formula with R1C1 references.

The formula with R1C1 references.

Boolean NeedsRecalculation { get; set; }

Flag indicating that previously calculated cell value may be not valid anymore and has to be re-evaluated.

Boolean ShareString { get; set; }

Gets or sets a value indicating whether this cell’s text should be shared or not.

If false the cell’s text will not be shared and stored as an inline value.

IXLStyle Style { get; set; }

Gets or sets the cell’s style.

XLCellValue Value { get; set; }

Gets or sets the cell’s value.

Getter will return value of a cell or value of formula. Getter will evaluate a formula, if the cell NeedsRecalculation, before returning up-to-date value.

Setter will clear a formula, if the cell contains a formula. If the value is a text that starts with a single quote, setter will prefix the value with a single quote through IXLStyle.IncludeQuotePrefix in Excel too and the value of cell is set to to non-quoted text.

interface IXLCells : public IEnumerable<IXLCell>

Subclassed by XLCells

Public Functions

IXLCells Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of these cells.

Param clearOptions

Specify what you want to clear.

void DeleteComments ()

Delete the comments of these cells.

void DeleteSparklines ()

Delete the sparklines of these cells.

Properties

XLCellValue Value { get; set; }

Sets the cells’ value.

Setter will clear a formula, if the cell contains a formula. If the value is a text that starts with a single quote, setter will prefix the value with a single quote through IXLStyle.IncludeQuotePrefix in Excel too and the value of cell is set to to non-quoted text.

String FormulaA1 { get; set; }

Sets the cells’ formula with A1 references.

The formula with A1 references.

String FormulaR1C1 { get; set; }

Sets the cells’ formula with R1C1 references.

The formula with R1C1 references.

interface IXLCFColorScaleMax

Subclassed by XLCFColorScaleMax

interface IXLCFColorScaleMid

Subclassed by XLCFColorScaleMid

interface IXLCFColorScaleMin

Subclassed by XLCFColorScaleMin

interface IXLCFConverter

Subclassed by XLCFCellIsConverter, XLCFColorScaleConverter, XLCFContainsConverter, XLCFDataBarConverter, XLCFDatesOccurringConverter, XLCFEndsWithConverter, XLCFIconSetConverter, XLCFIsBlankConverter, XLCFIsErrorConverter, XLCFNotBlankConverter, XLCFNotContainsConverter, XLCFNotErrorConverter, XLCFStartsWithConverter, XLCFTopConverter, XLCFUniqueConverter

interface IXLCFConverterExtension

Subclassed by XLCFDataBarConverterExtension

interface IXLCFDataBarMax

Subclassed by XLCFDataBarMax

interface IXLCFDataBarMin

Subclassed by XLCFDataBarMin

interface IXLCFIconSet

Subclassed by XLCFIconSet

interface IXLChart : public IXLDrawing<IXLChart>

Subclassed by XLChart

interface IXLCharts : public IEnumerable<IXLChart>

Subclassed by XLCharts

interface IXLColumn : public IXLRangeBase

Subclassed by XLColumn

Public Functions

void Delete ()

Deletes this column and shifts the columns at the right of this one accordingly.

Don’t use in a loop due to poor performance. Use IXLRange.Delete(XLShiftDeletedCells) instead.

Int32 ColumnNumber ()

Gets this column’s number

String ColumnLetter ()

Gets this column’s letter

IXLColumns InsertColumnsAfter (Int32 numberOfColumns)

Inserts X number of columns at the right of this one.

All columns at the right will be shifted accordingly.

Param numberOfColumns

The number of columns to insert.

IXLColumns InsertColumnsBefore (Int32 numberOfColumns)

Inserts X number of columns at the left of this one.

This column and all at the right will be shifted accordingly.

Param numberOfColumns

The number of columns to insert.

IXLCell Cell (Int32 rowNumber)

Gets the cell in the specified row.

Param rowNumber

The cell’s row.

new IXLCells Cells (String cellsInColumn)

Returns the specified group of cells, separated by commas.

e.g. Cells(“1”), Cells(“1:5”), Cells(“1,3:5”)

Param cellsInColumn

The column cells to return.

IXLCells Cells (Int32 firstRow, Int32 lastRow)

Returns the specified group of cells.

Param firstRow

The first row in the group of cells to return.

Param lastRow

The last row in the group of cells to return.

IXLColumn AdjustToContents ()

Adjusts the width of the column based on its contents.

IXLColumn AdjustToContents (Int32 startRow)

Adjusts the width of the column based on its contents, starting from the startRow.

Param startRow

The row to start calculating the column width.

IXLColumn AdjustToContents (Int32 startRow, Int32 endRow)

Adjusts the width of the column based on its contents, starting from the startRow and ending at endRow.

Param startRow

The row to start calculating the column width.

Param endRow

The row to end calculating the column width.

IXLColumn Hide ()

Hides this column.

IXLColumn Unhide ()

Unhides this column.

IXLColumn Group ()

Adds this column to the next outline level (Increments the outline level for this column by 1).

IXLColumn Group (Boolean collapse)

Adds this column to the next outline level (Increments the outline level for this column by 1).

Param collapse

If set to true the column will be shown collapsed.

IXLColumn Group (Int32 outlineLevel)

Sets outline level for this column.

Param outlineLevel

The outline level.

IXLColumn Group (Int32 outlineLevel, Boolean collapse)

Sets outline level for this column.

Param outlineLevel

The outline level.

Param collapse

If set to true the column will be shown collapsed.

IXLColumn Ungroup ()

Adds this column to the previous outline level (decrements the outline level for this column by 1).

IXLColumn Ungroup (Boolean fromAll)

Adds this column to the previous outline level (decrements the outline level for this column by 1).

Param fromAll

If set to true it will remove this column from all outline levels.

IXLColumn Collapse ()

Show this column as collapsed.

IXLColumn Expand ()

Expands this column (if it’s collapsed).

IXLColumn AddVerticalPageBreak ()

Adds a vertical page break after this column.

new IXLColumn Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of this column.

Param clearOptions

Specify what you want to clear.

Properties

Double Width { get; set; }

Gets or sets the width of this column.

The width of the column as multiple of maximum digit width (MDW). MDW is a maximum width of a 0-9 digit character.

Boolean IsHidden { get; set; }

Gets a value indicating whether this column is hidden or not.

true if this column is hidden; otherwise, false.

Int32 OutlineLevel { get; set; }

Gets or sets the outline level of this column.

The outline level of this column.

interface IXLColumns : public System::Collections::IEnumerable<IXLColumn>

Subclassed by XLColumns

Public Functions

void Delete ()

Deletes all columns and shifts the columns at the right of them accordingly.

IXLColumns AdjustToContents ()

Adjusts the width of all columns based on its contents.

IXLColumns AdjustToContents (Int32 startRow)

Adjusts the width of all columns based on its contents, starting from the startRow.

Param startRow

The row to start calculating the column width.

IXLColumns AdjustToContents (Int32 startRow, Int32 endRow)

Adjusts the width of all columns based on its contents, starting from the startRow and ending at endRow.

Param startRow

The row to start calculating the column width.

Param endRow

The row to end calculating the column width.

void Hide ()

Hides all columns.

void Unhide ()

Unhides all columns.

void Group ()

Increments the outline level of all columns by 1.

void Group (Boolean collapse)

Increments the outline level of all columns by 1.

Param collapse

If set to true the columns will be shown collapsed.

void Group (Int32 outlineLevel)

Sets outline level for all columns.

Param outlineLevel

The outline level.

void Group (Int32 outlineLevel, Boolean collapse)

Sets outline level for all columns.

Param outlineLevel

The outline level.

Param collapse

If set to true the columns will be shown collapsed.

void Ungroup ()

Decrements the outline level of all columns by 1.

void Ungroup (Boolean fromAll)

Decrements the outline level of all columns by 1.

Param fromAll

If set to true it will remove the columns from all outline levels.

void Collapse ()

Show all columns as collapsed.

void Expand ()

Expands all columns (if they’re collapsed).

IXLCells Cells ()

Returns the collection of cells.

IXLCells CellsUsed ()

Returns the collection of cells that have a value.

IXLCells CellsUsed (Boolean includeFormats)

Returns the collection of cells that have a value.

Param includeFormats

if set to true will return all cells with a value or a style different than the default.

IXLColumns AddVerticalPageBreaks ()

Adds a vertical page break after these columns.

IXLColumns Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of these columns.

Param clearOptions

Specify what you want to clear.

Properties

Double Width { get; set; }

Sets the width of all columns.

The width of all columns.

interface IXLComment : public IXLFormattedText<IXLComment>, public IXLDrawing<IXLComment>

Subclassed by XLComment

Public Functions

IXLComment SetAuthor (String value)

Sets the name of the comment’s author

Param value

Author’s name

IXLRichString AddSignature ()

Adds a bolded line with the author’s name

Properties

String Author { get; set; }

Gets or sets this comment’s author’s name

interface IXLConditionalFormat

Subclassed by XLConditionalFormat

Properties

IXLRange Range { get; set; }

The first of the Ranges.

interface IXLConditionalFormats : public IEnumerable<IXLConditionalFormat>

Subclassed by XLConditionalFormats

interface IXLCustomFilteredColumn

Subclassed by XLCustomFilteredColumn

interface IXLCustomProperties : public IEnumerable<IXLCustomProperty>

Subclassed by XLCustomProperties

interface IXLCustomProperty

Subclassed by XLCustomProperty

interface IXLDataValidation

Subclassed by XLDataValidation

Public Functions

void AddRange (IXLRange range)

Add a range to the collection of ranges this rule applies to. If the specified range does not belong to the worksheet of the data validation rule it is transferred to the target worksheet.

Param range

A range to add.

void AddRanges (IEnumerable<IXLRange> ranges)

Add a collection of ranges to the collection of ranges this rule applies to. Ranges that do not belong to the worksheet of the data validation rule are transferred to the target worksheet.

Param ranges

Ranges to add.

void ClearRanges ()

Detach data validation rule of all ranges it applies to.

bool RemoveRange (IXLRange range)

Remove the specified range from the collection of range this rule applies to.

Param range

A range to remove.

Properties

IXLRange > Ranges { get; set; }

A collection of ranges the data validation rule applies too.

interface IXLDataValidations : public System::Collections::IEnumerable<IXLDataValidation>

Subclassed by XLDataValidations

Public Functions

IXLDataValidation Add (IXLDataValidation dataValidation)

Add data validation rule to the collection. If the specified rule refers to another worksheet than the collection, the copy will be created and its ranges will refer to the worksheet of the collection. Otherwise the original instance will be placed in the collection.

Param dataValidation

A data validation rule to add.

Return

The instance that has actually been added in the collection (may be a copy of the specified one).

IEnumerable<IXLDataValidation> GetAllInRange (IXLRangeAddress rangeAddress)

Get all data validation rules applied to ranges that intersect the specified range.

bool TryGet (IXLRangeAddress rangeAddress, out IXLDataValidation dataValidation)

Get the data validation rule for the range with the specified address if it exists.

Param rangeAddress

A range address.

Param dataValidation

Data validation rule which ranges collection includes the specified address. The specified range should be fully covered with the data validation rule. For example, if the rule is applied to ranges A1:A3,C1:C3 then this method will return True for ranges A1:A3, C1:C2, A2:A3, and False for ranges A1:C3, A1:C1, etc.

Return

True is the data validation rule was found, false otherwise.

interface IXLDateTimeGroupFilteredColumn

Subclassed by XLDateTimeGroupFilteredColumn

interface IXLDrawing<T>

Subclassed by XLDrawing< T >

interface IXLDrawingAlignment

Subclassed by XLDrawingAlignment

interface IXLDrawingColorsAndLines

Subclassed by XLDrawingColorsAndLines

interface IXLDrawingFont : public IXLFontBase

Subclassed by XLDrawingFont

interface IXLDrawingMargins

Subclassed by XLDrawingMargins

interface IXLDrawingPosition

Subclassed by XLDrawingPosition

interface IXLDrawingProperties

Subclassed by XLDrawingProperties

interface IXLDrawingProtection

Subclassed by XLDrawingProtection

interface IXLDrawingSize

Subclassed by XLDrawingSize

interface IXLDrawingStyle

Subclassed by XLDrawingStyle

interface IXLDrawingWeb

Subclassed by XLDrawingWeb

interface IXLElementProtection<T> : public ICloneable, public IXLElementProtection

Public Functions

IXLElementProtection<T> AllowElement (T element, Boolean allowed = true)

Adds the specified element to the list of allowed elements. Beware that if you pass through “None”, this will have no effect.

Param element

The element to add

Param allowed

Set to true to allow the element or false to disallow the element

Return

The current protection instance

IXLElementProtection<T> AllowEverything ()

Allows all elements to be edited.

IXLElementProtection<T> AllowNone ()

Allows no elements to be edited. Protects all elements.

IXLElementProtection<T> CopyFrom (IXLElementProtection<T> protectable)

Copies all the protection settings from a different instance.

Param protectable

The protectable.

IXLElementProtection<T> DisallowElement (T element)

Removes the element to the list of allowed elements. Beware that if you pass through “None”, this will have no effect.

Param element

The element to remove

Return

The current protection instance

IXLElementProtection<T> Protect (Algorithm algorithm = DefaultProtectionAlgorithm)

Protects this instance without a password.

Param algorithm

The algorithm.

IXLElementProtection<T> Protect (String password, Algorithm algorithm = DefaultProtectionAlgorithm)

Protects this instance using the specified password and password hash algorithm.

Param password

The password.

Param algorithm

The algorithm.

IXLElementProtection<T> Unprotect ()

Unprotects this instance without a password.

IXLElementProtection<T> Unprotect (String password)

Unprotects this instance using the specified password.

Param password

The password.

Properties

T AllowedElements { get; set; }

Gets or sets the elements that are allowed to be edited by the user, i.e. those that are not protected.

The allowed elements.

Algorithm Algorithm { get; set; }

Gets the algorithm used to hash the password.

The algorithm.

Boolean IsPasswordProtected { get; set; }

Gets a value indicating whether this instance is protected with a password.

true if this instance is password protected; otherwise, false.

Boolean IsProtected { get; set; }

Gets a value indicating whether this instance is protected, either with or without a password.

true if this instance is protected; otherwise, false.

interface IXLFileSharing

Subclassed by XLFileSharing

interface IXLFill : public IEquatable<IXLFill>

Subclassed by XLFill

interface IXLFilterColumn

Subclassed by XLFilterColumn

interface IXLFilterConnector

Subclassed by XLFilterConnector

interface IXLFilteredColumn

Subclassed by XLFilteredColumn

interface IXLFont : public IXLFontBase, public IEquatable<IXLFont>

Subclassed by XLFont

interface IXLFontBase

Subclassed by IXLDrawingFont, IXLFont, IXLPhonetics, IXLRichString

interface IXLFormattedText<T> : public System::Collections::IEnumerable<IXLRichString>, public IEquatable<IXLFormattedText<T>>, public IXLWithRichString

Subclassed by XLFormattedText< T >

Public Functions

IXLFormattedText<T> CopyFrom (IXLFormattedText<T> original)

Copy the text and formatting from the original text.

Param original

Original to copy from.

Return

This text.

interface IXLHeaderFooter

Subclassed by XLHeaderFooter

Public Functions

String GetText (XLHFOccurrence occurrence)

Gets the text of the specified header/footer occurrence.

Param occurrence

The occurrence.

Properties

IXLHFItem Left { get; set; }

Gets the left header/footer item.

IXLHFItem Center { get; set; }

Gets the middle header/footer item.

IXLHFItem Right { get; set; }

Gets the right header/footer item.

interface IXLHFItem : public IXLWithRichString

Subclassed by XLHFItem

Public Functions

String GetText (XLHFOccurrence occurrence)

Gets the text of the specified header/footer occurrence.

Param occurrence

The occurrence.

IXLRichString AddText (XLHFPredefinedText predefinedText)

Adds the given predefined text to this header/footer item.

Param predefinedText

The predefined text to add to this header/footer item.

IXLRichString AddText (String text, XLHFOccurrence occurrence)

Adds the given text to this header/footer item.

Param text

The text to add to this header/footer item.

Param occurrence

The occurrence for the text.

IXLRichString AddText (XLHFPredefinedText predefinedText, XLHFOccurrence occurrence)

Adds the given predefined text to this header/footer item.

Param predefinedText

The predefined text to add to this header/footer item.

Param occurrence

The occurrence for the predefined text.

void Clear (XLHFOccurrence occurrence = XLHFOccurrence.AllPages)

Clears the text/formats of this header/footer item.

Param occurrence

The occurrence to clear.

Subclassed by XLHyperlinks

interface IXLMargins

Subclassed by XLMargins

Properties

Double Left { get; set; }

Gets or sets the Left margin.

The Left margin.

Double Right { get; set; }

Gets or sets the Right margin.

The Right margin.

Double Top { get; set; }

Gets or sets the Top margin.

The Top margin.

Double Bottom { get; set; }

Gets or sets the Bottom margin.

The Bottom margin.

Double Header { get; set; }

Gets or sets the Header margin.

The Header margin.

Double Footer { get; set; }

Gets or sets the Footer margin.

The Footer margin.

interface IXLNamedRange

Subclassed by XLNamedRange

Public Functions

IXLRanges Add (XLWorkbook workbook, String rangeAddress)

Adds the specified range to this named range.

Note: A named range can point to multiple ranges.

Param workbook

Workbook containing the range

Param rangeAddress

The range address to add.

IXLRanges Add (IXLRange range)

Adds the specified range to this named range.

Note: A named range can point to multiple ranges.

Param range

The range to add.

IXLRanges Add (IXLRanges ranges)

Adds the specified ranges to this named range.

Note: A named range can point to multiple ranges.

Param ranges

The ranges to add.

void Clear ()

Clears the list of ranges associated with this named range.

(it does not clear the cells)

void Delete ()

Deletes this named range (not the cells).

void Remove (String rangeAddress)

Removes the specified range from this named range.

Note: A named range can point to multiple ranges.

Param rangeAddress

The range address to remove.

void Remove (IXLRange range)

Removes the specified range from this named range.

Note: A named range can point to multiple ranges.

Param range

The range to remove.

void Remove (IXLRanges ranges)

Removes the specified ranges from this named range.

Note: A named range can point to multiple ranges.

Param ranges

The ranges to remove.

Properties

String Comment { get; set; }

Gets or sets the comment for this named range.

The comment for this named range.

bool IsValid { get; set; }

Checks if the named range contains invalid references (#REF!).

String Name { get; set; }

Gets or sets the name of the range.

The name of the range.

IXLRanges Ranges { get; set; }

Gets the ranges associated with this named range.

Note: A named range can point to multiple ranges.

XLNamedRangeScope Scope { get; set; }

Gets the scope of this named range.

Boolean Visible { get; set; }

Gets or sets the visibility of this named range.

true if visible; otherwise, false.

interface IXLNamedRanges : public System::Collections::IEnumerable<IXLNamedRange>

Subclassed by XLNamedRanges

Public Functions

IXLNamedRange NamedRange (String rangeName)

Gets the specified named range.

Param rangeName

Name of the range.

IXLNamedRange Add (String rangeName, String rangeAddress)

Adds a new named range.

Param rangeName

Name of the range to add.

Param rangeAddress

The range address to add.

IXLNamedRange Add (String rangeName, IXLRange range)

Adds a new named range.

Param rangeName

Name of the range to add.

Param range

The range to add.

IXLNamedRange Add (String rangeName, IXLRanges ranges)

Adds a new named range.

Param rangeName

Name of the range to add.

Param ranges

The ranges to add.

IXLNamedRange Add (String rangeName, String rangeAddress, String comment)

Adds a new named range.

Param rangeName

Name of the ranges to add.

Param rangeAddress

The range address to add.

Param comment

The comment for the new named range.

IXLNamedRange Add (String rangeName, IXLRange range, String comment)

Adds a new named range.

Param rangeName

Name of the ranges to add.

Param range

The range to add.

Param comment

The comment for the new named range.

IXLNamedRange Add (String rangeName, IXLRanges ranges, String comment)

Adds a new named range.

Param rangeName

Name of the ranges to add.

Param ranges

The ranges to add.

Param comment

The comment for the new named range.

void Delete (String rangeName)

Deletes the specified named range (not the cells).

Param rangeName

Name of the range to delete.

void Delete (Int32 rangeIndex)

Deletes the specified named range’s index (not the cells).

Param rangeIndex

Index of the named range to delete.

void DeleteAll ()

Deletes all named ranges (not the cells).

IEnumerable<IXLNamedRange> ValidNamedRanges ()

Returns a subset of named ranges that do not have invalid references.

IEnumerable<IXLNamedRange> InvalidNamedRanges ()

Returns a subset of named ranges that do have invalid references.

interface IXLNumberFormat : public IXLNumberFormatBase, public IEquatable<IXLNumberFormatBase>

Subclassed by XLNumberFormat

interface IXLNumberFormatBase

Subclassed by IXLNumberFormat, IXLPivotValueFormat

interface IXLOutline

Subclassed by XLOutline

interface IXLPageSetup

Subclassed by XLPageSetup

Public Functions

void SetRowsToRepeatAtTop (String range)

Sets the rows to repeat on the top of the printed pages.

Param range

The range of rows to repeat on the top of the printed pages.

void SetRowsToRepeatAtTop (Int32 firstRowToRepeatAtTop, Int32 lastRowToRepeatAtTop)

Sets the rows to repeat on the top of the printed pages.

Param firstRowToRepeatAtTop

The first row to repeat at top.

Param lastRowToRepeatAtTop

The last row to repeat at top.

void SetColumnsToRepeatAtLeft (Int32 firstColumnToRepeatAtLeft, Int32 lastColumnToRepeatAtLeft)

Sets the rows to repeat on the left of the printed pages.

Param firstColumnToRepeatAtLeft

The first column to repeat at left.

Param lastColumnToRepeatAtLeft

The last column to repeat at left.

void SetColumnsToRepeatAtLeft (String range)

Sets the rows to repeat on the left of the printed pages.

Param range

The range of rows to repeat on the left of the printed pages.

void AdjustTo (Int32 percentageOfNormalSize)

Sets the scale at which the worksheet will be printed. This is equivalent to setting the Scale property.

The worksheet will be printed on as many pages as necessary to print at the given scale.

Setting this value will override the PagesWide and PagesTall values.

Param percentageOfNormalSize

The scale at which the worksheet will be printed.

void FitToPages (Int32 pagesWide, Int32 pagesTall)

Gets or sets the number of pages the worksheet will be printed on.

This is equivalent to setting both PagesWide and PagesTall properties.

Setting this value will override the Scale value.

Param pagesWide

The pages wide.

Param pagesTall

The pages tall.

void AddHorizontalPageBreak (Int32 row)

Adds a horizontal page break after the given row.

Param row

The row to insert the break.

void AddVerticalPageBreak (Int32 column)

Adds a vertical page break after the given column.

Param column

The column to insert the break.

Properties

IXLPrintAreas PrintAreas { get; set; }

Gets an object to manage the print areas of the worksheet.

Int32 FirstRowToRepeatAtTop { get; set; }

Gets the first row that will repeat on the top of the printed pages.

Use SetRowsToRepeatAtTop() to set the rows that will be repeated on the top of the printed pages.

Int32 LastRowToRepeatAtTop { get; set; }

Gets the last row that will repeat on the top of the printed pages.

Use SetRowsToRepeatAtTop() to set the rows that will be repeated on the top of the printed pages.

Int32 FirstColumnToRepeatAtLeft { get; set; }

Gets the first column to repeat on the left of the printed pages.

The first column to repeat on the left of the printed pages.

Int32 LastColumnToRepeatAtLeft { get; set; }

Gets the last column to repeat on the left of the printed pages.

The last column to repeat on the left of the printed pages.

XLPageOrientation PageOrientation { get; set; }

Gets or sets the page orientation for printing.

The page orientation.

Int32 PagesWide { get; set; }

Gets or sets the number of pages wide (horizontal) the worksheet will be printed on.

If you don’t specify the PagesTall, Excel will adjust that value

based on the contents of the worksheet and the PagesWide number.

Setting this value will override the Scale value.

Int32 PagesTall { get; set; }

Gets or sets the number of pages tall (vertical) the worksheet will be printed on.

If you don’t specify the PagesWide, Excel will adjust that value

based on the contents of the worksheet and the PagesTall number.

Setting this value will override the Scale value.

Int32 Scale { get; set; }

Gets or sets the scale at which the worksheet will be printed.

The worksheet will be printed on as many pages as necessary to print at the given scale.

Setting this value will override the PagesWide and PagesTall values.

Int32 HorizontalDpi { get; set; }

Gets or sets the horizontal dpi for printing the worksheet.

Int32 VerticalDpi { get; set; }

Gets or sets the vertical dpi for printing the worksheet.

UInt32? FirstPageNumber { get; set; }

Gets or sets the page number that will begin the printout.

For example, the first page of your printout could be numbered page 5.

Boolean CenterHorizontally { get; set; }

Gets or sets a value indicating whether the worksheet will be centered on the page horizontally.

true if the worksheet will be centered on the page horizontally; otherwise, false.

Boolean CenterVertically { get; set; }

Gets or sets a value indicating whether the worksheet will be centered on the page vertically.

true if the worksheet will be centered on the page vertically; otherwise, false.

XLPaperSize PaperSize { get; set; }

Gets or sets the size of the paper to print the worksheet.

IXLMargins Margins { get; set; }

Gets an object to work with the page margins.

IXLHeaderFooter Header { get; set; }

Gets an object to work with the page headers.

IXLHeaderFooter Footer { get; set; }

Gets an object to work with the page footers.

Boolean ScaleHFWithDocument { get; set; }

Gets or sets a value indicating whether Excel will automatically adjust the font size to the scale of the worksheet.

true if Excel will automatically adjust the font size to the scale of the worksheet; otherwise, false.

Boolean AlignHFWithMargins { get; set; }

Gets or sets a value indicating whether the header and footer margins are aligned with the left and right margins of the worksheet.

true if the header and footer margins are aligned with the left and right margins of the worksheet; otherwise, false.

Boolean ShowGridlines { get; set; }

Gets or sets a value indicating whether the gridlines will be printed.

true if the gridlines will be printed; otherwise, false.

Boolean ShowRowAndColumnHeadings { get; set; }

Gets or sets a value indicating whether to show row numbers and column letters/numbers.

true to show row numbers and column letters/numbers; otherwise, false.

Boolean BlackAndWhite { get; set; }

Gets or sets a value indicating whether the worksheet will be printed in black and white.

true if the worksheet will be printed in black and white; otherwise, false.

Boolean DraftQuality { get; set; }

Gets or sets a value indicating whether the worksheet will be printed in draft quality.

true if the worksheet will be printed in draft quality; otherwise, false.

XLPageOrderValues PageOrder { get; set; }

Gets or sets the page order for printing.

XLShowCommentsValues ShowComments { get; set; }

Gets or sets how the comments will be printed.

Int32 > RowBreaks { get; set; }

Gets a list with the row breaks (for printing).

Int32 > ColumnBreaks { get; set; }

Gets a list with the column breaks (for printing).

XLPrintErrorValues PrintErrorValue { get; set; }

Gets or sets how error values will be printed.

interface IXLPhonetic : public IEquatable<IXLPhonetic>

Subclassed by XLPhonetic

interface IXLPhonetics : public IXLFontBase, public System::Collections::IEnumerable<IXLPhonetic>, public IEquatable<IXLPhonetics>

Subclassed by XLPhonetics

interface IXLPivotField

Subclassed by XLPivotField

interface IXLPivotFields : public IEnumerable<IXLPivotField>

Subclassed by XLPivotFields

interface IXLPivotFieldStyleFormats

Subclassed by XLPivotFieldStyleFormats

interface IXLPivotStyleFormat

Subclassed by IXLPivotValueStyleFormat, XLPivotStyleFormat

interface IXLPivotStyleFormats : public IEnumerable<IXLPivotStyleFormat>

Subclassed by XLPivotStyleFormats

interface IXLPivotTable

Subclassed by XLPivotTable

interface IXLPivotTables : public IEnumerable<IXLPivotTable>

Subclassed by XLPivotTables

interface IXLPivotTableStyleFormats

Subclassed by XLPivotTableStyleFormats

interface IXLPivotValue

A pivot value field, it is basically a specification of how to determine and format values from source to display in the pivot table.

Subclassed by XLPivotValue

Properties

String BaseField { get; set; }

Name of a base field to calculate a value to show in the pivot table. The base field determines which base items can be used. Instead of base item, previous or next value can be used through CalculationItem

Used only if the value should be showed Show Values As in the value field settings.

Show values as a percent of a specific value of a different field, e.g. as a % of units sold from Q1 (quarts is a base field and Q1 is a base item).

XLCellValue BaseItem { get; set; }

The value of a base item to calculate a value to show in the pivot table. The base item is selected from values of a base field.

Used only if the value should be showed Show Values As in the value field settings.

Show values as a percent of a specific value of a different field, e.g. as a % of units sold from Q1 (quarts is a base field and Q1 is a base item).

interface IXLPivotValueCombination

Subclassed by XLPivotValueCombination

interface IXLPivotValueFormat : public IXLNumberFormatBase, public IEquatable<IXLNumberFormatBase>

Subclassed by XLPivotValueFormat

interface IXLPivotValues : public IEnumerable<IXLPivotValue>

Subclassed by XLPivotValues

interface IXLPivotValueStyleFormat : public IXLPivotStyleFormat

Subclassed by XLPivotValueStyleFormat

Public Functions

IXLPivotValueStyleFormat AndWith (IXLPivotField field, Predicate<XLCellValue> predicate)

Adds a further limitation so the IXLPivotStyleFormat.Style is only applied to cells in a pivot table that are are within the field that has some values.

The pivot style is bound by the field index in a pivot table, not field value. E.g. if field values are Jan, Feb and the predicate marks Feb (offset 1) = second field (Feb) will be highlighted. If user later reverses order in Excel to Feb, Jan, the style would still apply to the second value - Jan.

Param field

Only cells in a pivot table under this field will be styled.

Param predicate

A predicate to determine which index of the field should be styled.

interface IXLPrintAreas : public System::Collections::IEnumerable<IXLRange>

Subclassed by XLPrintAreas

Public Functions

void Clear ()

Removes the print areas from the worksheet.

void Add (Int32 firstCellRow, Int32 firstCellColumn, Int32 lastCellRow, Int32 lastCellColumn)

Adds a range to the print areas.

Param firstCellRow

The first cell row.

Param firstCellColumn

The first cell column.

Param lastCellRow

The last cell row.

Param lastCellColumn

The last cell column.

void Add (String rangeAddress)

Adds a range to the print areas.

Param rangeAddress

The range address to add.

void Add (String firstCellAddress, String lastCellAddress)

Adds a range to the print areas.

Param firstCellAddress

The first cell address.

Param lastCellAddress

The last cell address.

void Add (IXLAddress firstCellAddress, IXLAddress lastCellAddress)

Adds a range to the print areas.

Param firstCellAddress

The first cell address.

Param lastCellAddress

The last cell address.

interface IXLProtectable<TProtection, in TElement> : public IXLProtectable

Public Functions

TProtection Protect (TElement allowedElements)

Protects this instance without a password.

new TProtection Protect (Algorithm algorithm = DefaultProtectionAlgorithm)

Protects this instance without a password.

TProtection Protect (Algorithm algorithm, TElement allowedElements)

Protects this instance with the specified password, password hash algorithm and set elements that the user is allowed to change.

Param algorithm

The algorithm.

Param allowedElements

The allowed elements.

new TProtection Protect (String password, Algorithm algorithm = DefaultProtectionAlgorithm)

Protects this instance using the specified password and password hash algorithm.

Param password

The password.

Param algorithm

The algorithm.

TProtection Protect (String password, Algorithm algorithm, TElement allowedElements)

Protects this instance with the specified password, password hash algorithm and set elements that the user is allowed to change.

Param password

The password.

Param algorithm

The algorithm.

Param allowedElements

The allowed elements.

new TProtection Unprotect ()

Unprotects this instance without a password.

new TProtection Unprotect (String password)

Unprotects this instance using the specified password.

Param password

The password.

IXLElementProtection Protect (Algorithm algorithm = DefaultProtectionAlgorithm)

Protects this instance without a password.

IXLElementProtection Protect (String password, Algorithm algorithm = DefaultProtectionAlgorithm)

Protects this instance using the specified password and password hash algorithm.

Param password

The password.

Param algorithm

The algorithm.

IXLElementProtection Unprotect ()

Unprotects this instance without a password.

IXLElementProtection Unprotect (String password)

Unprotects this instance using the specified password.

Param password

The password.

Properties

Boolean IsPasswordProtected { get; set; }

Gets a value indicating whether this instance is protected with a password.

true if this instance is password protected; otherwise, false.

Boolean IsProtected { get; set; }

Gets a value indicating whether this instance is protected, either with or without a password.

true if this instance is protected; otherwise, false.

interface IXLProtection : public IEquatable<IXLProtection>

Subclassed by XLProtection

interface IXLRange : public IXLRangeBase

Subclassed by IXLTable, IXLTableRange, XLRange

Public Functions

IXLCell Cell (int row, int column)

Gets the cell at the specified row and column.

The cell address is relative to the parent range.

Param row

The cell’s row.

Param column

The cell’s column.

IXLCell Cell (string cellAddressInRange)

Gets the cell at the specified address.

The cell address is relative to the parent range.

Param cellAddressInRange

The cell address in the parent range.

IXLCell Cell (int row, string column)

Gets the cell at the specified row and column.

The cell address is relative to the parent range.

Param row

The cell’s row.

Param column

The cell’s column.

IXLCell Cell (IXLAddress cellAddressInRange)

Gets the cell at the specified address.

The cell address is relative to the parent range.

Param cellAddressInRange

The cell address in the parent range.

IXLRangeColumn Column (int columnNumber)

Gets the specified column of the range.

Param columnNumber

1-based column number relative to the first column of this range.

Return

The relevant column

IXLRangeColumn Column (string columnLetter)

Gets the specified column of the range.

Param columnLetter

Column letter.

IXLRangeColumn FirstColumn (Func<IXLRangeColumn, Boolean> predicate = null)

Gets the first column of the range.

IXLRangeColumn FirstColumnUsed (XLCellsUsedOptions options, Func<IXLRangeColumn, Boolean> predicate = null)

Gets the first non-empty column of the range that contains a cell with a value.

Param options

The options to determine whether a cell is used.

Param predicate

The predicate to choose cells.

IXLRangeColumn LastColumn (Func<IXLRangeColumn, Boolean> predicate = null)

Gets the last column of the range.

IXLRangeColumn LastColumnUsed (XLCellsUsedOptions options, Func<IXLRangeColumn, Boolean> predicate = null)

Gets the last non-empty column of the range that contains a cell with a value.

Param options

The options to determine whether a cell is used.

Param predicate

The predicate to choose cells.

IXLRangeColumns Columns (Func<IXLRangeColumn, Boolean> predicate = null)

Gets a collection of all columns in this range.

IXLRangeColumns Columns (int firstColumn, int lastColumn)

Gets a collection of the specified columns in this range.

Param firstColumn

The first column to return. 1-based column number relative to the first column of this range.

Param lastColumn

The last column to return. 1-based column number relative to the first column of this range.

IXLRangeColumns Columns (string firstColumn, string lastColumn)

Gets a collection of the specified columns in this range.

Param firstColumn

The first column to return.

Param lastColumn

The last column to return.

Return

The relevant columns

IXLRangeColumns Columns (string columns)

Gets a collection of the specified columns in this range, separated by commas.

e.g. Columns(“G:H”), Columns(“10:11,13:14”), Columns(“P:Q,S:T”), Columns(“V”)

Param columns

The columns to return.

IXLRangeColumn FindColumn (Func<IXLRangeColumn, Boolean> predicate)

Returns the first row that matches the given predicate

IXLRangeRow FindRow (Func<IXLRangeRow, Boolean> predicate)

Returns the first row that matches the given predicate

IXLRangeRow FirstRow (Func<IXLRangeRow, Boolean> predicate = null)

Gets the first row of the range.

IXLRangeRow FirstRowUsed (XLCellsUsedOptions options, Func<IXLRangeRow, Boolean> predicate = null)

Gets the first non-empty row of the range that contains a cell with a value.

Param options

The options to determine whether a cell is used.

Param predicate

The predicate to choose cells.

IXLRangeRow LastRow (Func<IXLRangeRow, Boolean> predicate = null)

Gets the last row of the range.

IXLRangeRow LastRowUsed (XLCellsUsedOptions options, Func<IXLRangeRow, Boolean> predicate = null)

Gets the last non-empty row of the range that contains a cell with a value.

Param options

The options to determine whether a cell is used.

Param predicate

The predicate to choose cells.

IXLRangeRow Row (int row)

Gets the specified row of the range.

Param row

1-based row number relative to the first row of this range.

Return

The relevant row

IXLRangeRows Rows (int firstRow, int lastRow)

Gets a collection of the specified rows in this range.

Param firstRow

The first row to return. 1-based row number relative to the first row of this range.

Param lastRow

The last row to return. 1-based row number relative to the first row of this range.

IXLRangeRows Rows (string rows)

Gets a collection of the specified rows in this range, separated by commas.

e.g. Rows(“4:5”), Rows(“7:8,10:11”), Rows(“13”)

Param rows

The rows to return.

IXLRange Range (IXLRangeAddress rangeAddress)

Returns the specified range.

Param rangeAddress

The range boundaries.

IXLRange Range (string rangeAddress)

Returns the specified range.

e.g. Range(“A1”), Range(“A1:C2”)

Param rangeAddress

The range boundaries.

IXLRange Range (IXLCell firstCell, IXLCell lastCell)

Returns the specified range.

Param firstCell

The first cell in the range.

Param lastCell

The last cell in the range.

IXLRange Range (string firstCellAddress, string lastCellAddress)

Returns the specified range.

Param firstCellAddress

The first cell address in the range.

Param lastCellAddress

The last cell address in the range.

IXLRange Range (IXLAddress firstCellAddress, IXLAddress lastCellAddress)

Returns the specified range.

Param firstCellAddress

The first cell address in the range.

Param lastCellAddress

The last cell address in the range.

IXLRanges Ranges (string ranges)

Returns a collection of ranges, separated by commas.

e.g. Ranges(“A1”), Ranges(“A1:C2”), Ranges(“A1:B2,D1:D4”)

Param ranges

The ranges to return.

IXLRange Range (int firstCellRow, int firstCellColumn, int lastCellRow, int lastCellColumn)

Returns the specified range.

Param firstCellRow

The first cell’s row of the range to return.

Param firstCellColumn

The first cell’s column of the range to return.

Param lastCellRow

The last cell’s row of the range to return.

Param lastCellColumn

The last cell’s column of the range to return.

Return

.

int RowCount ()

Gets the number of rows in this range.

int ColumnCount ()

Gets the number of columns in this range.

IXLRangeColumns InsertColumnsAfter (int numberOfColumns)

Inserts X number of columns to the right of this range.

All cells to the right of this range will be shifted X number of columns.

Param numberOfColumns

Number of columns to insert.

IXLRangeColumns InsertColumnsBefore (int numberOfColumns)

Inserts X number of columns to the left of this range.

This range and all cells to the right of this range will be shifted X number of columns.

Param numberOfColumns

Number of columns to insert.

IXLRangeRows InsertRowsAbove (int numberOfRows)

Inserts X number of rows on top of this range.

This range and all cells below this range will be shifted X number of rows.

Param numberOfRows

Number of rows to insert.

IXLRangeRows InsertRowsBelow (int numberOfRows)

Inserts X number of rows below this range.

All cells below this range will be shifted X number of rows.

Param numberOfRows

Number of rows to insert.

void Delete (XLShiftDeletedCells shiftDeleteCells)

Deletes this range and shifts the surrounding cells accordingly.

Param shiftDeleteCells

How to shift the surrounding cells.

void Transpose (XLTransposeOptions transposeOption)

Transposes the contents and styles of all cells in this range.

Param transposeOption

How to handle the surrounding cells when transposing the range.

IXLTable AsTable ()

Use this range as a table, but do not add it to the Tables list

NOTES:

The AsTable method will use the first row of the range as a header row.

If this range contains only one row, then an empty data row will be inserted into the returned table.

IXLTable AsTable (String name)

Use this range as a table with the passed name, but do not add it to the Tables list

NOTES:

The AsTable method will use the first row of the range as a header row.

If this range contains only one row, then an empty data row will be inserted into the returned table.

Param name

Table name to be used.

new IXLRange Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of this range.

Param clearOptions

Specify what you want to clear.

interface IXLRangeAddress

Subclassed by XLRangeAddress

Public Functions

IXLRange AsRange ()

Allocates the current range address in the internal range repository and returns it

IXLRangeAddress Intersection (IXLRangeAddress otherRangeAddress)

Returns the intersection of this range address with another range address on the same worksheet.

Param otherRangeAddress

The other range address.

Return

The intersection’s range address

Boolean IsEntireColumn ()

Determines whether range address spans the entire column.

Return

true if is entire column; otherwise, false.

Boolean IsEntireRow ()

Determines whether range address spans the entire row.

Return

true if is entire row; otherwise, false.

Boolean IsEntireSheet ()

Determines whether the range address spans the entire worksheet.

Return

true if is entire sheet; otherwise, false.

IXLRangeAddress Relative (IXLRangeAddress sourceRangeAddress, IXLRangeAddress targetRangeAddress)

Returns a range address so that its offset from the target base address is equal to the offset of the current range address to the source base address. For example, if the current range address is D4:E4, the source base address is A1:C3, then the relative address to the target base address B10:D13 is E14:F14

Param sourceRangeAddress

The source base range address.

Param targetRangeAddress

The target base range address.

Return

The relative range

Properties

int ColumnSpan { get; set; }

Gets the number of columns in the area covered by the range address.

IXLAddress FirstAddress { get; set; }

Gets or sets the first address in the range.

The first address.

Boolean IsValid { get; set; }

Gets or sets a value indicating whether this range is valid.

true if this instance is valid; otherwise, false.

IXLAddress LastAddress { get; set; }

Gets or sets the last address in the range.

The last address.

int NumberOfCells { get; set; }

Gets the number of cells in the area covered by the range address.

int RowSpan { get; set; }

Gets the number of rows in the area covered by the range address.

interface IXLRangeBase : public IXLAddressable

Subclassed by IXLColumn, IXLRange, IXLRangeColumn, IXLRangeRow, IXLRow, IXLWorksheet, XLRangeBase

Public Functions

IXLCells Cells ()

Returns the collection of cells.

IXLCells CellsUsed ()

Returns the collection of cells that have a value. Formats are ignored.

IXLCells CellsUsed (XLCellsUsedOptions options)

Returns the collection of cells that have a value.

Param options

The options to determine whether a cell is used.

IXLCells Search (String searchText, CompareOptions compareOptions = CompareOptions.Ordinal, Boolean searchFormulae = false)

Searches the cells’ contents for a given piece of text

Param searchText

The search text.

Param compareOptions

The compare options.

Param searchFormulae

if set to true search formulae instead of cell values.

IXLCell FirstCell ()

Returns the first cell of this range.

IXLCell FirstCellUsed ()

Returns the first non-empty cell with a value of this range. Formats are ignored.

The cell’s address is going to be ([First Row with a value], [First Column with a value])

IXLCell FirstCellUsed (XLCellsUsedOptions options)

Returns the first non-empty cell with a value of this range.

Param options

The options to determine whether a cell is used.

IXLCell FirstCellUsed (XLCellsUsedOptions options, Func<IXLCell, Boolean> predicate)

Returns the first non-empty cell with a value of this range.

Param options

The options to determine whether a cell is used.

Param predicate

The predicate used to choose cells

IXLCell LastCell ()

Returns the last cell of this range.

IXLCell LastCellUsed ()

Returns the last non-empty cell with a value of this range. Formats are ignored.

The cell’s address is going to be ([Last Row with a value], [Last Column with a value])

IXLCell LastCellUsed (XLCellsUsedOptions options)

Returns the last non-empty cell with a value of this range.

Param options

The options to determine whether a cell is used.

Boolean Contains (String rangeAddress)

Determines whether this range contains the specified range (completely).

For partial matches use the range.Intersects method.

Param rangeAddress

The range address.

Return

true if this range contains the specified range; otherwise, false.

Boolean Contains (IXLRangeBase range)

Determines whether this range contains the specified range (completely).

For partial matches use the range.Intersects method.

Param range

The range to match.

Return

true if this range contains the specified range; otherwise, false.

Boolean Intersects (String rangeAddress)

Determines whether this range intersects the specified range.

For whole matches use the range.Contains method.

Param rangeAddress

The range address.

Return

true if this range intersects the specified range; otherwise, false.

Boolean Intersects (IXLRangeBase range)

Determines whether this range contains the specified range.

For whole matches use the range.Contains method.

Param range

The range to match.

Return

true if this range intersects the specified range; otherwise, false.

IXLRange Unmerge ()

Unmerges this range.

IXLRange Merge ()

Merges this range. Only the top-left cell will have a value, other values will be blank.

IXLRange AddToNamed (String rangeName)

Creates a named range out of this range.

If the named range exists, it will add this range to that named range.

The default scope for the named range is Workbook.

Param rangeName

Name of the range.

IXLRange AddToNamed (String rangeName, XLScope scope)

Creates a named range out of this range.

If the named range exists, it will add this range to that named range.

Param rangeName

Name of the range.

Param scope

The scope for the named range.

IXLRange AddToNamed (String rangeName, XLScope scope, String comment)

Creates a named range out of this range.

If the named range exists, it will add this range to that named range.

Param rangeName

Name of the range.

Param scope

The scope for the named range.

Param comment

The comments for the named range.

IXLRangeBase Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of this range.

Param clearOptions

Specify what you want to clear.

void DeleteComments ()

Deletes the cell comments from this range.

IXLRangeBase SetValue (XLCellValue value)

Set value to all cells in the range.

IXLRange AsRange ()

Converts this object to a range.

Boolean IsEntireColumn ()

Determines whether range address spans the entire column.

Return

true if is entire column; otherwise, false.

Boolean IsEntireRow ()

Determines whether range address spans the entire row.

Return

true if is entire row; otherwise, false.

Boolean IsEntireSheet ()

Determines whether the range address spans the entire worksheet.

Return

true if is entire sheet; otherwise, false.

IXLDataValidation GetDataValidation ()

Returns a data validation rule assigned to the range, if any, or creates a new instance of data validation rule if no rule exists.

IXLDataValidation CreateDataValidation ()

Creates a new data validation rule for the range, replacing the existing one.

IXLRangeBase Grow ()

Grows this the current range by one cell to each side

IXLRangeBase Grow (Int32 growCount)

Grows this the current range by the specified number of cells to each side.

Param growCount

The grow count.

IXLRangeBase Shrink ()

Shrinks this current range by one cell.

IXLRangeBase Shrink (Int32 shrinkCount)

Shrinks the current range by the specified number of cells from each side.

Param shrinkCount

The shrink count.

IXLRangeAddress Intersection (IXLRangeBase otherRange, Func<IXLCell, Boolean> thisRangePredicate = null, Func<IXLCell, Boolean> otherRangePredicate = null)

Returns the intersection of this range with another range on the same worksheet.

Param otherRange

The other range.

Param thisRangePredicate

Predicate applied to this range’s cells.

Param otherRangePredicate

Predicate applied to the other range’s cells.

Return

The range address of the intersection

IXLCells SurroundingCells (Func<IXLCell, Boolean> predicate = null)

Returns the set of cells surrounding the current range.

Param predicate

The predicate to apply on the resulting set of cells.

IXLCells Union (IXLRangeBase otherRange, Func<IXLCell, Boolean> thisRangePredicate = null, Func<IXLCell, Boolean> otherRangePredicate = null)

Calculates the union of two ranges on the same worksheet.

Param otherRange

The other range.

Param thisRangePredicate

Predicate applied to this range’s cells.

Param otherRangePredicate

Predicate applied to the other range’s cells.

Return

The union

IXLCells Difference (IXLRangeBase otherRange, Func<IXLCell, Boolean> thisRangePredicate = null, Func<IXLCell, Boolean> otherRangePredicate = null)

Returns all cells in the current range that are not in the other range.

Param otherRange

The other range.

Param thisRangePredicate

Predicate applied to this range’s cells.

Param otherRangePredicate

Predicate applied to the other range’s cells.

IXLRangeBase Relative (IXLRangeBase sourceBaseRange, IXLRangeBase targetBaseRange)

Returns a range so that its offset from the target base range is equal to the offset of the current range to the source base range. For example, if the current range is D4:E4, the source base range is A1:C3, then the relative range to the target base range B10:D13 is E14:F14

Param sourceBaseRange

The source base range.

Param targetBaseRange

The target base range.

Return

The relative range

Properties

XLCellValue Value { get; set; }

Sets a value to every cell in this range.

Setter will clear a formula, if the cell contains a formula. If the value is a text that starts with a single quote, setter will prefix the value with a single quote through IXLStyle.IncludeQuotePrefix in Excel too and the value of cell is set to to non-quoted text.

String FormulaA1 { get; set; }

Sets the cells’ formula with A1 references.

The formula with A1 references.

String FormulaR1C1 { get; set; }

Sets the cells’ formula with R1C1 references.

The formula with R1C1 references.

Boolean ShareString { get; set; }

Gets or sets a value indicating whether this cell’s text should be shared or not.

If false the cell’s text will not be shared and stored as an inline value.

interface IXLRangeColumn : public IXLRangeBase

Subclassed by XLRangeColumn

Public Functions

IXLCell Cell (Int32 rowNumber)

Gets the cell in the specified row.

Param rowNumber

The cell’s row.

new IXLCells Cells (String cellsInColumn)

Returns the specified group of cells, separated by commas.

e.g. Cells(“1”), Cells(“1:5”), Cells(“1:2,4:5”)

Param cellsInColumn

The column cells to return.

IXLCells Cells (Int32 firstRow, Int32 lastRow)

Returns the specified group of cells.

Param firstRow

The first row in the group of cells to return.

Param lastRow

The last row in the group of cells to return.

IXLRangeColumns InsertColumnsAfter (int numberOfColumns)

Inserts X number of columns to the right of this range.

All cells to the right of this range will be shifted X number of columns.

Param numberOfColumns

Number of columns to insert.

IXLRangeColumns InsertColumnsBefore (int numberOfColumns)

Inserts X number of columns to the left of this range.

This range and all cells to the right of this range will be shifted X number of columns.

Param numberOfColumns

Number of columns to insert.

IXLCells InsertCellsAbove (int numberOfRows)

Inserts X number of cells on top of this column.

This column and all cells below it will be shifted X number of rows.

Param numberOfRows

Number of cells to insert.

IXLCells InsertCellsBelow (int numberOfRows)

Inserts X number of cells below this range.

All cells below this column will be shifted X number of rows.

Param numberOfRows

Number of cells to insert.

void Delete ()

Deletes this range and shifts the cells at the right.

void Delete (XLShiftDeletedCells shiftDeleteCells)

Deletes this range and shifts the surrounding cells accordingly.

Param shiftDeleteCells

How to shift the surrounding cells.

Int32 ColumnNumber ()

Gets this column’s number in the range

String ColumnLetter ()

Gets this column’s letter in the range

new IXLRangeColumn Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of this column.

Param clearOptions

Specify what you want to clear.

interface IXLRangeColumns : public System::Collections::IEnumerable<IXLRangeColumn>

Subclassed by XLRangeColumns

Public Functions

void Add (IXLRangeColumn columRange)

Adds a column range to this group.

Param columRange

The column range to add.

IXLCells Cells ()

Returns the collection of cells.

IXLCells CellsUsed ()

Returns the collection of cells that have a value.

IXLCells CellsUsed (XLCellsUsedOptions options)

Returns the collection of cells that have a value.

Param options

The options to determine whether a cell is used.

void Delete ()

Deletes all columns and shifts the columns at the right of them accordingly.

IXLRangeColumns Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of these columns.

Param clearOptions

Specify what you want to clear.

interface IXLRangeRow : public IXLRangeBase

Subclassed by IXLTableRow, XLRangeRow

Public Functions

IXLCell Cell (Int32 columnNumber)

Gets the cell in the specified column.

Param columnNumber

The cell’s column.

IXLCell Cell (String columnLetter)

Gets the cell in the specified column.

Param columnLetter

The cell’s column.

new IXLCells Cells (String cellsInRow)

Returns the specified group of cells, separated by commas.

e.g. Cells(“1”), Cells(“1:5”), Cells(“1:2,4:5”)

Param cellsInRow

The row’s cells to return.

IXLCells Cells (Int32 firstColumn, Int32 lastColumn)

Returns the specified group of cells.

Param firstColumn

The first column in the group of cells to return.

Param lastColumn

The last column in the group of cells to return.

IXLCells Cells (String firstColumn, String lastColumn)

Returns the specified group of cells.

Param firstColumn

The first column in the group of cells to return.

Param lastColumn

The last column in the group of cells to return.

IXLCells InsertCellsAfter (int numberOfColumns)

Inserts X number of cells to the right of this row.

All cells to the right of this row will be shifted X number of columns.

Param numberOfColumns

Number of cells to insert.

IXLCells InsertCellsBefore (int numberOfColumns)

Inserts X number of cells to the left of this row.

This row and all cells to the right of it will be shifted X number of columns.

Param numberOfColumns

Number of cells to insert.

IXLRangeRows InsertRowsAbove (int numberOfRows)

Inserts X number of rows on top of this row.

This row and all cells below it will be shifted X number of rows.

Param numberOfRows

Number of rows to insert.

IXLRangeRows InsertRowsBelow (int numberOfRows)

Inserts X number of rows below this row.

All cells below this row will be shifted X number of rows.

Param numberOfRows

Number of rows to insert.

void Delete ()

Deletes this range and shifts the cells below.

void Delete (XLShiftDeletedCells shiftDeleteCells)

Deletes this range and shifts the surrounding cells accordingly.

Param shiftDeleteCells

How to shift the surrounding cells.

Int32 RowNumber ()

Gets this row’s number in the range

new IXLRangeRow Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of this row.

Param clearOptions

Specify what you want to clear.

interface IXLRangeRows : public IEnumerable<IXLRangeRow>

Subclassed by XLRangeRows

Public Functions

void Add (IXLRangeRow rowRange)

Adds a row range to this group.

Param rowRange

The row range to add.

IXLCells Cells ()

Returns the collection of cells.

IXLCells CellsUsed ()

Returns the collection of cells that have a value.

IXLCells CellsUsed (XLCellsUsedOptions options)

Returns the collection of cells that have a value.

Param options

The options to determine whether a cell is used.

void Delete ()

Deletes all rows and shifts the rows below them accordingly.

IXLRangeRows Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of these rows.

Param clearOptions

Specify what you want to clear.

interface IXLRanges : public IEnumerable<IXLRange>

Subclassed by XLRanges

Public Functions

void Add (IXLRangeBase range)

Adds the specified range to this group.

Param range

The range to add to this group.

bool Remove (IXLRange range)

Removes the specified range from this group.

Param range

The range to remove from this group.

void RemoveAll (Predicate<IXLRange> match = null, bool releaseEventHandlers = true)

Removes ranges matching the criteria from the collection, optionally releasing their event handlers.

Param match

Criteria to filter ranges. Only those ranges that satisfy the criteria will be removed. Null means the entire collection should be cleared.

Param releaseEventHandlers

Specify whether or not should removed ranges be unsubscribed from row/column shifting events. Until ranges are unsubscribed they cannot be collected by GC.

IEnumerable<IXLRange> GetIntersectedRanges (IXLRangeAddress rangeAddress)

Filter ranges from a collection that intersect the specified address. Is much more efficient that using Linq expression .Where().

IEnumerable<IXLRange> GetIntersectedRanges (IXLAddress address)

Filter ranges from a collection that intersect the specified address. Is much more efficient that using Linq expression .Where().

IEnumerable<IXLRange> GetIntersectedRanges (IXLCell cell)

Filter ranges from a collection that intersect the specified cell. Is much more efficient that using Linq expression .Where().

IXLDataValidation CreateDataValidation ()

Creates a new data validation rule for the ranges collection, replacing the existing ones.

IXLRanges AddToNamed (String rangeName)

Creates a named range out of these ranges.

If the named range exists, it will add these ranges to that named range.

The default scope for the named range is Workbook.

Param rangeName

Name of the range.

IXLRanges AddToNamed (String rangeName, XLScope scope)

Creates a named range out of these ranges.

If the named range exists, it will add these ranges to that named range.

Param rangeName

Name of the range.

Param scope

The scope for the named range.

IXLRanges AddToNamed (String rangeName, XLScope scope, String comment)

Creates a named range out of these ranges.

If the named range exists, it will add these ranges to that named range.

Param rangeName

Name of the range.

Param scope

The scope for the named range.

Param comment

The comments for the named range.

IXLCells Cells ()

Returns the collection of cells.

IXLCells CellsUsed ()

Returns the collection of cells that have a value.

IXLCells CellsUsed (XLCellsUsedOptions options)

Returns the collection of cells that have a value.

Param options

The options to determine whether a cell is used.

IXLRanges Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of these ranges.

Param clearOptions

Specify what you want to clear.

IXLRanges Consolidate ()

Create a new collection of ranges which are consolidated version of source ranges.

Properties

XLCellValue Value { get; set; }

Sets the cells’ value.

Setter will clear a formula, if the cell contains a formula. If the value is a text that starts with a single quote, setter will prefix the value with a single quote through IXLStyle.IncludeQuotePrefix in Excel too and the value of cell is set to to non-quoted text.

interface IXLRichString : public IXLFontBase, public IEquatable<IXLRichString>, public IXLWithRichString

Subclassed by XLRichString

interface IXLRichText : public IXLFormattedText<IXLRichText>

Subclassed by XLRichText

interface IXLRow : public IXLRangeBase

Subclassed by XLRow

Public Functions

void ClearHeight ()

Clears the height for the row and defaults it to the spreadsheet row height.

void Delete ()

Deletes this row and shifts the rows below this one accordingly.

Don’t use in a loop due to poor performance. Use IXLRange.Delete(XLShiftDeletedCells) instead.

Int32 RowNumber ()

Gets this row’s number

IXLRows InsertRowsBelow (Int32 numberOfRows)

Inserts X number of rows below this one.

All rows below will be shifted accordingly.

Param numberOfRows

The number of rows to insert.

IXLRows InsertRowsAbove (Int32 numberOfRows)

Inserts X number of rows above this one.

This row and all below will be shifted accordingly.

Param numberOfRows

The number of rows to insert.

IXLRow AdjustToContents (Int32 startColumn)

Adjusts the height of the row based on its contents, starting from the startColumn.

Param startColumn

The column to start calculating the row height.

IXLRow AdjustToContents (Int32 startColumn, Int32 endColumn)

Adjusts the height of the row based on its contents, starting from the startColumn and ending at endColumn.

Param startColumn

The column to start calculating the row height.

Param endColumn

The column to end calculating the row height.

IXLRow Hide ()

Hides this row.

IXLRow Unhide ()

Unhides this row.

IXLRow Group ()

Adds this row to the next outline level (Increments the outline level for this row by 1).

IXLRow Group (Boolean collapse)

Adds this row to the next outline level (Increments the outline level for this row by 1).

Param collapse

If set to true the row will be shown collapsed.

IXLRow Group (Int32 outlineLevel)

Sets outline level for this row.

Param outlineLevel

The outline level.

IXLRow Group (Int32 outlineLevel, Boolean collapse)

Sets outline level for this row.

Param outlineLevel

The outline level.

Param collapse

If set to true the row will be shown collapsed.

IXLRow Ungroup ()

Adds this row to the previous outline level (decrements the outline level for this row by 1).

IXLRow Ungroup (Boolean fromAll)

Adds this row to the previous outline level (decrements the outline level for this row by 1).

Param fromAll

If set to true it will remove this row from all outline levels.

IXLRow Collapse ()

Show this row as collapsed.

IXLCell Cell (Int32 columnNumber)

Gets the cell in the specified column.

Param columnNumber

The cell’s column.

IXLCell Cell (String columnLetter)

Gets the cell in the specified column.

Param columnLetter

The cell’s column.

new IXLCells Cells (String cellsInRow)

Returns the specified group of cells, separated by commas.

e.g. Cells(“1”), Cells(“1:5”), Cells(“1,3:5”)

Param cellsInRow

The row’s cells to return.

IXLCells Cells (Int32 firstColumn, Int32 lastColumn)

Returns the specified group of cells.

Param firstColumn

The first column in the group of cells to return.

Param lastColumn

The last column in the group of cells to return.

IXLCells Cells (String firstColumn, String lastColumn)

Returns the specified group of cells.

Param firstColumn

The first column in the group of cells to return.

Param lastColumn

The last column in the group of cells to return.

IXLRow Expand ()

Expands this row (if it’s collapsed).

IXLRow AddHorizontalPageBreak ()

Adds a horizontal page break after this row.

new IXLRow Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of this row.

Param clearOptions

Specify what you want to clear.

Properties

Double Height { get; set; }

Gets or sets the height of this row.

The width of this row in points.

Boolean IsHidden { get; set; }

Gets a value indicating whether this row is hidden or not.

true if this row is hidden; otherwise, false.

Int32 OutlineLevel { get; set; }

Gets or sets the outline level of this row.

The outline level of this row.

interface IXLRows : public IEnumerable<IXLRow>

Subclassed by XLRows

Public Functions

void Delete ()

Deletes all rows and shifts the rows below them accordingly.

IXLRows AdjustToContents ()

Adjusts the height of all rows based on its contents.

IXLRows AdjustToContents (Int32 startColumn)

Adjusts the height of all rows based on its contents, starting from the startColumn.

Param startColumn

The column to start calculating the row height.

IXLRows AdjustToContents (Int32 startColumn, Int32 endColumn)

Adjusts the height of all rows based on its contents, starting from the startColumn and ending at endColumn.

Param startColumn

The column to start calculating the row height.

Param endColumn

The column to end calculating the row height.

void Hide ()

Hides all rows.

void Unhide ()

Unhides all rows.

void Group ()

Increments the outline level of all rows by 1.

void Group (Boolean collapse)

Increments the outline level of all rows by 1.

Param collapse

If set to true the rows will be shown collapsed.

void Group (Int32 outlineLevel)

Sets outline level for all rows.

Param outlineLevel

The outline level.

void Group (Int32 outlineLevel, Boolean collapse)

Sets outline level for all rows.

Param outlineLevel

The outline level.

Param collapse

If set to true the rows will be shown collapsed.

void Ungroup ()

Decrements the outline level of all rows by 1.

void Ungroup (Boolean fromAll)

Decrements the outline level of all rows by 1.

Param fromAll

If set to true it will remove the rows from all outline levels.

void Collapse ()

Show all rows as collapsed.

void Expand ()

Expands all rows (if they’re collapsed).

IXLCells Cells ()

Returns the collection of cells.

IXLCells CellsUsed ()

Returns the collection of cells that have a value.

IXLCells CellsUsed (XLCellsUsedOptions options)

Returns the collection of cells that have a value.

Param options

The options to determine whether a cell is used.

IXLRows AddHorizontalPageBreaks ()

Adds a horizontal page break after these rows.

IXLRows Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of these rows.

Param clearOptions

Specify what you want to clear.

Properties

Double Height { get; set; }

Sets the height of all rows.

The height of all rows.

interface IXLSheetProtection : public IXLElementProtection<XLSheetProtectionElements>

Subclassed by XLSheetProtection

interface IXLSheetView

Subclassed by XLSheetView

Public Functions

void Freeze (Int32 rows, Int32 columns)

Freezes the specified rows and columns.

Param rows

The rows to freeze.

Param columns

The columns to freeze.

void FreezeColumns (Int32 columns)

Freezes the left X columns.

Param columns

The columns to freeze.

void FreezeRows (Int32 rows)

Freezes the top X rows.

Param rows

The rows to freeze.

Properties

Int32 SplitColumn { get; set; }

Gets or sets the column after which the horizontal split should take place.

Int32 SplitRow { get; set; }

Gets or sets the row after which the vertical split should take place.

IXLAddress TopLeftCellAddress { get; set; }

Gets or sets the location of the top left visible cell

The scroll position’s top left cell.

Int32 ZoomScale { get; set; }

Window zoom magnification for current view representing percent values. Horizontal and vertical scale together.

Representing percent values ranging from 10 to 400.

Int32 ZoomScaleNormal { get; set; }

Zoom magnification to use when in normal view. Horizontal and vertical scale together

Representing percent values ranging from 10 to 400.

Int32 ZoomScalePageLayoutView { get; set; }

Zoom magnification to use when in page layout view. Horizontal and vertical scale together.

Representing percent values ranging from 10 to 400.

Int32 ZoomScaleSheetLayoutView { get; set; }

Zoom magnification to use when in page break preview. Horizontal and vertical scale together.

Representing percent values ranging from 10 to 400.

interface IXLSortElement

Subclassed by XLSortElement

interface IXLSortElements : public IEnumerable<IXLSortElement>

Subclassed by XLSortElements

interface IXLSparkline

Subclassed by XLSparkline

interface IXLSparklineGroup : public IEnumerable<IXLSparkline>

Subclassed by XLSparklineGroup

interface IXLSparklineGroups : public IEnumerable<IXLSparklineGroup>

Subclassed by XLSparklineGroups

interface IXLSparklineHorizontalAxis

Subclassed by XLSparklineHorizontalAxis

interface IXLSparklineStyle

Subclassed by XLSparklineStyle

interface IXLSparklineVerticalAxis

Subclassed by XLSparklineVerticalAxis

interface IXLStyle : public IEquatable<IXLStyle>

Subclassed by XLStyle

Properties

Boolean IncludeQuotePrefix { get; set; }

Should the text values of a cell saved to the file be prefixed by a quote (') character? Has no effect if cell values is not a XLDataType.Text. Doesn’t affect values during runtime, text values are returned without quote.

interface IXLStylized

Subclassed by XLCell, XLCells, XLColumns, XLConditionalFormat, XLRangeBase, XLRangeColumns, XLRangeRows, XLRanges, XLRows, XLStylizedBase, XLStylizedEmpty, XLTableRows

Properties

XLStyleValue StyleValue { get; set; }

Immutable style

interface IXLTable : public IXLRange

Subclassed by XLTable

Public Functions

new IXLTable Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of this table.

Param clearOptions

Specify what you want to clear.

IXLRange AppendData (IEnumerable data, Boolean propagateExtraColumns = false)

Appends the IEnumerable data elements and returns the range of the new rows.

Param data

The IEnumerable data.

Param propagateExtraColumns

if set to true propagate extra columns’ values and formulas.

Return

The range of the new rows.

IXLRange AppendData (IEnumerable data, Boolean transpose, Boolean propagateExtraColumns = false)

Appends the IEnumerable data elements and returns the range of the new rows.

Param data

The IEnumerable data.

Param transpose

if set to true the data will be transposed before inserting.

Param propagateExtraColumns

if set to true propagate extra columns’ values and formulas.

Return

The range of the new rows.

IXLRange AppendData (DataTable dataTable, Boolean propagateExtraColumns = false)

Appends the data of a data table and returns the range of the new rows.

Param dataTable

The data table.

Param propagateExtraColumns

if set to true propagate extra columns’ values and formulas.

Return

The range of the new rows.

IXLRange AppendData<T> (IEnumerable<T> data, Boolean propagateExtraColumns = false)

Appends the IEnumerable data elements and returns the range of the new rows.

Tparam T

Param data

The table data.

Param propagateExtraColumns

if set to true propagate extra columns’ values and formulas.

Return

The range of the new rows.

IXLRange ReplaceData (IEnumerable data, Boolean propagateExtraColumns = false)

Replaces the IEnumerable data elements and returns the table’s data range.

Param data

The IEnumerable data.

Param propagateExtraColumns

if set to true propagate extra columns’ values and formulas.

Return

The table’s data range.

IXLRange ReplaceData (IEnumerable data, Boolean transpose, Boolean propagateExtraColumns = false)

Replaces the IEnumerable data elements and returns the table’s data range.

Param data

The IEnumerable data.

Param transpose

if set to true the data will be transposed before inserting.

Param propagateExtraColumns

if set to true propagate extra columns’ values and formulas.

Return

The table’s data range.

IXLRange ReplaceData (DataTable dataTable, Boolean propagateExtraColumns = false)

Replaces the data from the records of a data table and returns the table’s data range.

Param dataTable

The data table.

Param propagateExtraColumns

if set to true propagate extra columns’ values and formulas.

Return

The table’s data range.

IXLRange ReplaceData<T> (IEnumerable<T> data, Boolean propagateExtraColumns = false)

Replaces the IEnumerable data elements as a table and the table’s data range.

Tparam T

Param data

The table data.

Param propagateExtraColumns

if set to true propagate extra columns’ values and formulas.

Return

The table’s data range.

IXLTable Resize (IXLRange range)

Resizes the table to the specified range address.

Param range

The new table range.

IXLTable Resize (IXLRangeAddress rangeAddress)

Resizes the table to the specified range address.

Param rangeAddress

The range boundaries.

IXLTable Resize (string rangeAddress)

Resizes the table to the specified range address.

Param rangeAddress

The range boundaries.

IXLTable Resize (IXLCell firstCell, IXLCell lastCell)

Resizes the table to the specified range.

Param firstCell

The first cell in the range.

Param lastCell

The last cell in the range.

IXLTable Resize (string firstCellAddress, string lastCellAddress)

Resizes the table to the specified range.

Param firstCellAddress

The first cell address in the worksheet.

Param lastCellAddress

The last cell address in the worksheet.

IXLTable Resize (IXLAddress firstCellAddress, IXLAddress lastCellAddress)

Resizes the table to the specified range.

Param firstCellAddress

The first cell address in the worksheet.

Param lastCellAddress

The last cell address in the worksheet.

IXLTable Resize (int firstCellRow, int firstCellColumn, int lastCellRow, int lastCellColumn)

Resizes the table to the specified range.

Param firstCellRow

The first cell’s row of the range to return.

Param firstCellColumn

The first cell’s column of the range to return.

Param lastCellRow

The last cell’s row of the range to return.

Param lastCellColumn

The last cell’s column of the range to return.

IEnumerable<dynamic> AsDynamicEnumerable ()

Converts the table to an enumerable of dynamic objects

DataTable AsNativeDataTable ()

Converts the table to a standard .NET System.Data.DataTable

interface IXLTableField

Subclassed by XLTableField

Public Functions

void Delete ()

Deletes this table field from the table.

Boolean IsConsistentDataType ()

Determines whether all cells this table field have a consistent data type.

Boolean IsConsistentFormula ()

Determines whether all cells this table field have a consistent formula.

Boolean IsConsistentStyle ()

Determines whether all cells this table field have a consistent style.

Properties

IXLRangeColumn Column { get; set; }

Gets the corresponding column for this table field. Includes the header and footer cells

The column.

IXLCells DataCells { get; set; }

Gets the collection of data cells for this field Excludes the header and footer cells

The data cells

IXLCell TotalsCell { get; set; }

Gets the footer cell for the table field.

The footer cell.

IXLCell HeaderCell { get; set; }

Gets the header cell for the table field.

The header cell.

Int32 Index { get; set; }

Gets the index of the column (0-based).

The index.

String Name { get; set; }

Gets or sets the name/header of this table field. The corresponding header cell’s value will change if you set this.

The name.

IXLTable Table { get; set; }

Gets the underlying table for this table field.

String TotalsRowFormulaA1 { get; set; }

Gets or sets the totals row formula in A1 format.

The totals row formula a1.

String TotalsRowFormulaR1C1 { get; set; }

Gets or sets the totals row formula in R1C1 format.

The totals row formula r1 c1.

XLTotalsRowFunction TotalsRowFunction { get; set; }

Gets or sets the totals row function.

The totals row function.

String TotalsRowLabel { get; set; }

Gets or sets the totals row label.

The totals row label.

interface IXLTableRange : public IXLRange

Subclassed by XLTableRange

Public Functions

new IXLTableRows InsertRowsAbove (int numberOfRows)

Inserts X number of rows on top of this range.

This range and all cells below this range will be shifted X number of rows.

Param numberOfRows

Number of rows to insert.

new IXLTableRows InsertRowsBelow (int numberOfRows)

Inserts X number of rows below this range.

All cells below this range will be shifted X number of rows.

Param numberOfRows

Number of rows to insert.

new IXLTableRow Row (int row)

Rows the specified row.

Param row

1-based row number relative to the first row of this range.

new IXLTableRows Rows (int firstRow, int lastRow)

Returns a subset of the rows

Param firstRow

The first row to return. 1-based row number relative to the first row of this range.

Param lastRow

The last row to return. 1-based row number relative to the first row of this range.

new IXLTableRows Rows (string rows)

Gets a collection of the specified rows in this range, separated by commas.

e.g. Rows(“4:5”), Rows(“7:8,10:11”), Rows(“13”)

Param rows

The rows to return.

interface IXLTableRow : public IXLRangeRow

Subclassed by XLTableRow

Public Functions

new IXLTableRow Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of this row.

Param clearOptions

Specify what you want to clear.

new IXLTableRows InsertRowsAbove (int numberOfRows)

Inserts X number of rows on top of this row.

This row and all cells below it will be shifted X number of rows.

Param numberOfRows

Number of rows to insert.

new IXLTableRows InsertRowsBelow (int numberOfRows)

Inserts X number of rows below this row.

All cells below this row will be shifted X number of rows.

Param numberOfRows

Number of rows to insert.

interface IXLTableRows : public IEnumerable<IXLTableRow>

Subclassed by XLTableRows

Public Functions

void Add (IXLTableRow tableRow)

Adds a table row to this group.

Param tableRow

The row table to add.

IXLCells Cells ()

Returns the collection of cells.

IXLCells CellsUsed ()

Returns the collection of cells that have a value.

IXLCells CellsUsed (XLCellsUsedOptions options)

Returns the collection of cells that have a value.

Param options

The options to determine whether a cell is used.

IXLTableRows Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of these rows.

Param clearOptions

Specify what you want to clear.

interface IXLTables : public IEnumerable<IXLTable>

Subclassed by XLTables

Public Functions

IXLTables Clear (XLClearOptions clearOptions = XLClearOptions.All)

Clears the contents of these tables.

Param clearOptions

Specify what you want to clear.

interface IXLTheme

Subclassed by XLTheme

interface IXLValidationCriteria

Subclassed by XLValidationCriteria

interface IXLWithRichString

Subclassed by IXLFormattedText< T >, IXLHFItem, IXLRichString

interface IXLWorkbook : public IXLProtectable<IXLWorkbookProtection, XLWorkbookProtectionElements>, public IDisposable

Subclassed by XLWorkbook

Public Functions

XLCellValue Evaluate (String expression)

Evaluate a formula expression.

Param expression

Formula expression to evaluate.

Throws MissingContextException

If the expression contains a function that requires a context (e.g. current cell or worksheet).

void RecalculateAllFormulas ()

Force recalculation of all cell formulas.

void Save ()

Saves the current workbook.

void Save (Boolean validate, Boolean evaluateFormulae = false)

Saves the current workbook and optionally performs validation

void SaveAs (String file)

Saves the current workbook to a file.

void SaveAs (String file, Boolean validate, Boolean evaluateFormulae = false)

Saves the current workbook to a file and optionally validates it.

void SaveAs (Stream stream)

Saves the current workbook to a stream.

void SaveAs (Stream stream, Boolean validate, Boolean evaluateFormulae = false)

Saves the current workbook to a stream and optionally validates it.

IEnumerable<IXLCell> Search (String searchText, CompareOptions compareOptions = CompareOptions.Ordinal, Boolean searchFormulae = false)

Searches the cells’ contents for a given piece of text

Param searchText

The search text.

Param compareOptions

The compare options.

Param searchFormulae

if set to true search formulae instead of cell values.

IXLTable Table (String tableName, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase)

Gets the Excel table of the given name

Param tableName

Name of the table to return.

Param comparisonType

One of the enumeration values that specifies how the strings will be compared.

Throws ArgumentOutOfRangeException

If no tables with this name could be found in the workbook.

Return

The table with given name

Properties

XLCalculateMode CalculateMode { get; set; }

Gets or sets the workbook’s calculation mode.

Double ColumnWidth { get; set; }

Gets or sets the default column width for the workbook.

All new worksheets will use this column width.

IXLNamedRanges NamedRanges { get; set; }

Gets an object to manipulate this workbook’s named ranges.

IXLOutline Outline { get; set; }

Gets or sets the default outline options for the workbook.

All new worksheets will use these outline options.

IXLPageSetup PageOptions { get; set; }

Gets or sets the default page options for the workbook.

All new worksheets will use these page options.

XLWorkbookProperties Properties { get; set; }

Gets or sets the workbook’s properties.

XLReferenceStyle ReferenceStyle { get; set; }

Gets or sets the workbook’s reference style.

Double RowHeight { get; set; }

Gets or sets the default row height for the workbook.

All new worksheets will use this row height.

IXLStyle Style { get; set; }

Gets or sets the default style for the workbook.

All new worksheets will use this style.

IXLTheme Theme { get; set; }

Gets an object to manipulate this workbook’s theme.

IXLWorksheets Worksheets { get; set; }

Gets an object to manipulate the worksheets.

interface IXLWorkbookProtection : public IXLElementProtection<XLWorkbookProtectionElements>

Subclassed by XLWorkbookProtection

interface IXLWorksheet : public IXLRangeBase, public IXLProtectable<IXLSheetProtection, XLSheetProtectionElements>

Subclassed by XLWorksheet

Public Functions

IXLRow FirstRow ()

Gets the first row of the worksheet.

IXLRow FirstRowUsed ()

Gets the first non-empty row of the worksheet that contains a cell with a value.

Formatted empty cells do not count.

IXLRow FirstRowUsed (XLCellsUsedOptions options)

Gets the first non-empty row of the worksheet that contains a cell with a value.

Param options

The options to determine whether a cell is used.

IXLRow LastRow ()

Gets the last row of the worksheet.

IXLRow LastRowUsed ()

Gets the last non-empty row of the worksheet that contains a cell with a value.

IXLRow LastRowUsed (XLCellsUsedOptions options)

Gets the last non-empty row of the worksheet that contains a cell with a value.

Param options

The options to determine whether a cell is used.

IXLColumn FirstColumn ()

Gets the first column of the worksheet.

IXLColumn FirstColumnUsed ()

Gets the first non-empty column of the worksheet that contains a cell with a value.

IXLColumn FirstColumnUsed (XLCellsUsedOptions options)

Gets the first non-empty column of the worksheet that contains a cell with a value.

Param options

The options to determine whether a cell is used.

IXLColumn LastColumn ()

Gets the last column of the worksheet.

IXLColumn LastColumnUsed ()

Gets the last non-empty column of the worksheet that contains a cell with a value.

IXLColumn LastColumnUsed (XLCellsUsedOptions options)

Gets the last non-empty column of the worksheet that contains a cell with a value.

Param options

The options to determine whether a cell is used.

IXLColumns Columns ()

Gets a collection of all columns in this worksheet.

IXLColumns Columns (String columns)

Gets a collection of the specified columns in this worksheet, separated by commas.

e.g. Columns(“G:H”), Columns(“10:11,13:14”), Columns(“P:Q,S:T”), Columns(“V”)

Param columns

The columns to return.

IXLColumns Columns (String firstColumn, String lastColumn)

Gets a collection of the specified columns in this worksheet.

Param firstColumn

The first column to return.

Param lastColumn

The last column to return.

IXLColumns Columns (Int32 firstColumn, Int32 lastColumn)

Gets a collection of the specified columns in this worksheet.

Param firstColumn

The first column to return.

Param lastColumn

The last column to return.

IXLRows Rows ()

Gets a collection of all rows in this worksheet.

IXLRows Rows (String rows)

Gets a collection of the specified rows in this worksheet, separated by commas.

e.g. Rows(“4:5”), Rows(“7:8,10:11”), Rows(“13”)

Param rows

The rows to return.

IXLRows Rows (Int32 firstRow, Int32 lastRow)

Gets a collection of the specified rows in this worksheet.

Param firstRow

The first row to return.

Param lastRow

The last row to return.

IXLRow Row (Int32 row)

Gets the specified row of the worksheet.

Param row

The worksheet’s row.

IXLColumn Column (Int32 column)

Gets the specified column of the worksheet.

Param column

The worksheet’s column.

IXLColumn Column (String column)

Gets the specified column of the worksheet.

Param column

The worksheet’s column.

IXLCell Cell (int row, int column)

Gets the cell at the specified row and column.

Param row

The cell’s row.

Param column

The cell’s column.

IXLCell Cell (string cellAddressInRange)

Gets the cell at the specified address.

Param cellAddressInRange

The cell address in the worksheet.

IXLCell Cell (int row, string column)

Gets the cell at the specified row and column.

Param row

The cell’s row.

Param column

The cell’s column.

IXLCell Cell (IXLAddress cellAddressInRange)

Gets the cell at the specified address.

Param cellAddressInRange

The cell address in the worksheet.

IXLRange Range (IXLRangeAddress rangeAddress)

Returns the specified range.

Param rangeAddress

The range boundaries.

IXLRange Range (string rangeAddress)

Returns the specified range.

e.g. Range(“A1”), Range(“A1:C2”)

Param rangeAddress

The range boundaries.

IXLRange Range (IXLCell firstCell, IXLCell lastCell)

Returns the specified range.

Param firstCell

The first cell in the range.

Param lastCell

The last cell in the range.

IXLRange Range (string firstCellAddress, string lastCellAddress)

Returns the specified range.

Param firstCellAddress

The first cell address in the worksheet.

Param lastCellAddress

The last cell address in the worksheet.

IXLRange Range (IXLAddress firstCellAddress, IXLAddress lastCellAddress)

Returns the specified range.

Param firstCellAddress

The first cell address in the worksheet.

Param lastCellAddress

The last cell address in the worksheet.

IXLRanges Ranges (string ranges)

Returns a collection of ranges, separated by commas.

e.g. Ranges(“A1”), Ranges(“A1:C2”), Ranges(“A1:B2,D1:D4”)

Param ranges

The ranges to return.

IXLRange Range (int firstCellRow, int firstCellColumn, int lastCellRow, int lastCellColumn)

Returns the specified range.

Param firstCellRow

The first cell’s row of the range to return.

Param firstCellColumn

The first cell’s column of the range to return.

Param lastCellRow

The last cell’s row of the range to return.

Param lastCellColumn

The last cell’s column of the range to return.

Return

.

int RowCount ()

Gets the number of rows in this worksheet.

int ColumnCount ()

Gets the number of columns in this worksheet.

IXLWorksheet CollapseRows ()

Collapses all outlined rows.

IXLWorksheet CollapseColumns ()

Collapses all outlined columns.

IXLWorksheet ExpandRows ()

Expands all outlined rows.

IXLWorksheet ExpandColumns ()

Expands all outlined columns.

IXLWorksheet CollapseRows (Int32 outlineLevel)

Collapses the outlined rows of the specified level.

Param outlineLevel

The outline level.

IXLWorksheet CollapseColumns (Int32 outlineLevel)

Collapses the outlined columns of the specified level.

Param outlineLevel

The outline level.

IXLWorksheet ExpandRows (Int32 outlineLevel)

Expands the outlined rows of the specified level.

Param outlineLevel

The outline level.

IXLWorksheet ExpandColumns (Int32 outlineLevel)

Expands the outlined columns of the specified level.

Param outlineLevel

The outline level.

void Delete ()

Deletes this worksheet.

IXLNamedRange NamedRange (String rangeName)

Gets the specified named range.

Param rangeName

Name of the range.

IXLTable Table (Int32 index)

Gets the Excel table of the given index

Param index

Index of the table to return

IXLTable Table (String name)

Gets the Excel table of the given name

Param name

Name of the table to return

IXLWorksheet CopyTo (String newSheetName)

Copies the

Param newSheetName

IXLWorksheet CopyTo (XLWorkbook workbook, String newSheetName)

Copy a worksheet from this workbook to a different workbook as a new sheet.

Param workbook

Workbook into which copy this sheet.

Param newSheetName

Name of new sheet in the workbook where will the data be copied. Sheet will be in the last position.

Return

Newly created sheet in the workbook .

XLCellValue Evaluate (String expression, string formulaAddress = null)

Evaluate an formula and return a result.

Param expression

Formula to evaluate.

Param formulaAddress

A cell address that is used to provide context for formula calculation (mostly implicit intersection).

Throws MissingContextException

If formulaAddress was needed for some part of calculation.

void RecalculateAllFormulas ()

Force recalculation of all cell formulas.

Properties

XLWorkbook Workbook { get; set; }

Gets the workbook that contains this worksheet

Double ColumnWidth { get; set; }

Gets or sets the default column width for this worksheet.

Double RowHeight { get; set; }

Gets or sets the default row height for this worksheet.

String Name { get; set; }

Gets or sets the name (caption) of this worksheet.

Int32 Position { get; set; }

Gets or sets the position of the sheet.

When setting the Position all other sheets’ positions are shifted accordingly.

IXLPageSetup PageSetup { get; set; }

Gets an object to manipulate the sheet’s print options.

IXLOutline Outline { get; set; }

Gets an object to manipulate the Outline levels.

IXLNamedRanges NamedRanges { get; set; }

Gets an object to manage this worksheet’s named ranges.

IXLSheetView SheetView { get; set; }

Gets an object to manage how the worksheet is going to displayed by Excel.

IXLTables Tables { get; set; }

Gets an object to manage this worksheet’s Excel tables

interface IXLWorksheets : public System::Collections::IEnumerable<IXLWorksheet>

Subclassed by XLWorksheets

class LoadOptions

A class that defines various aspects of a newly created workbook.

Properties

IXLGraphicEngine DefaultGraphicEngine { get; set; }

A graphics engine that will be used for workbooks without explicitly set engine.

Boolean RecalculateAllFormulas { get; set; } = false

Should all formulas in a workbook be recalculated during load? Default value is false.

IXLGraphicEngine GraphicEngine { get; set; }

Graphic engine used by the workbook.

Point? Dpi { get; set; }

DPI for the workbook. Default is 96.

Used in various places, e.g. determining a physical size of an image without a DPI or to determine a size of a text in a cell.

class ObjectExtensions
class PivotLabelFieldReference : public AbstractPivotFieldReference
class PivotValueFieldReference : public AbstractPivotFieldReference
class RangeEventArgs : public EventArgs
class SaveOptions

Properties

Boolean EvaluateFormulasBeforeSaving { get; set; } = false

Evaluate a cells with a formula and save the calculated value along with the formula.

  • True - formulas are evaluated and the calculated values are saved to the file. If evaluation of a formula throws an exception, value is not saved but file is still saved.

  • False (default) - formulas are not evaluated and the formula cells don’t have their values saved to the file.

Boolean? FilterPrivacy { get; set; }

Gets or sets the filter privacy flag. Set to null to leave the current property in saved workbook unchanged

class StringExtensions
class TimeSpanExtensions

Public Static Functions

String ToExcelString (this TimeSpan ts, CultureInfo culture)

Return a string representation of a TimeSpan that can be parsed by an Excel through text-to-number coercion.

Excel can convert time span string back to a number, but only if it doesn’t has days in the string, only hours. It’s an opposite of TimeSpanParser.

class TypeExtensions
class XDocumentExtensions
struct XLAddress : public IXLAddress, public IEquatable<XLAddress>

Public Functions

XLAddress (int rowNumber, string columnLetter, bool fixedRow, bool fixedColumn)

Initializes a new XLAddress struct using a mixed notation. Attention: without worksheet for calculation only!

Param rowNumber

The row number of the cell address.

Param columnLetter

The column letter of the cell address.

Param fixedRow

Param fixedColumn

XLAddress (XLWorksheet worksheet, int rowNumber, string columnLetter, bool fixedRow, bool fixedColumn)

Initializes a new XLAddress struct using a mixed notation.

Param worksheet

Param rowNumber

The row number of the cell address.

Param columnLetter

The column letter of the cell address.

Param fixedRow

Param fixedColumn

XLAddress (int rowNumber, int columnNumber, bool fixedRow, bool fixedColumn)

Initializes a new XLAddress struct using R1C1 notation. Attention: without worksheet for calculation only!

Param rowNumber

The row number of the cell address.

Param columnNumber

The column number of the cell address.

Param fixedRow

Param fixedColumn

XLAddress (XLWorksheet worksheet, int rowNumber, int columnNumber, bool fixedRow, bool fixedColumn)

Initializes a new XLAddress struct using R1C1 notation.

Param worksheet

Param rowNumber

The row number of the cell address.

Param columnNumber

The column number of the cell address.

Param fixedRow

Param fixedColumn

Properties

Int32 RowNumber { get; set; }

Gets the row number of this address.

Int32 ColumnNumber { get; set; }

Gets the column number of this address.

String ColumnLetter { get; set; }

Gets the column letter(s) of this address.

Public Static Functions

XLAddress Create (string cellAddressString)

Create address without worksheet. For calculation only!

Param cellAddressString

class XLAlignment : public IXLAlignment

Public Functions

XLAlignment (XLStyle style, XLAlignmentValue value)

Create an instance of XLAlignment initializing it with the specified value.

Param style

Style to attach the new instance to.

Param value

Style value to use.

struct XLAlignmentKey : public IEquatable<XLAlignmentKey>
class XLAlignmentValue
class XLAutoFilter : public IXLAutoFilter
class XLBorder : public IXLBorder

Public Functions

XLBorder (IXLStylized container, XLStyle style, XLBorderValue value)

Create an instance of XLBorder initializing it with the specified value.

Param container

Container the border is applied to.

Param style

Style to attach the new instance to.

Param value

Style value to use.

struct XLBorderKey : public IEquatable<XLBorderKey>
class XLBorderValue
class XLCell : public XLStylizedBase, public IXLCell, public IXLStylized

Public Functions

void Evaluate (Boolean force)

Perform an evaluation of cell formula. If cell does not contain formula nothing happens, if cell does not need recalculation (NeedsRecalculation is False) nothing happens either, unless force flag is specified. Otherwise recalculation is performed, result value is preserved in CachedValue and returned.

Param force

Flag indicating whether a recalculation must be performed even is cell does not need it.

Return

Null if cell does not contain a formula. Calculated value otherwise.

Public Members

IXLSparkline Sparkline = > Worksheet.SparklineGroups.GetSparkline(this)

The sparkline assigned to the cell

Properties

bool ShareString { get; set; }

A flag indicating if a string should be stored in the shared table or inline.

bool NeedsRecalculation { get; set; }

Flag indicating that previously calculated cell value may be not valid anymore and has to be re-evaluated.

class XLCells : public XLStylizedBase, public IXLCells, public IXLStylized, public System::Collections::IEnumerable<XLCell>
class XLCellsCollection
struct XLCellValue : public IEquatable<XLCellValue>, public IEquatable<Blank>, public IEquatable<Boolean>, public IEquatable<Double>, public IEquatable<String>, public IEquatable<XLError>, public IEquatable<DateTime>, public IEquatable<TimeSpan>, public IEquatable<int>

A value of a single cell. It contains a value a specific Type. Structure provides following group of methods:

  • Is* properties to check type (IsNumber, IsBlank…)

  • Get* methods that return the stored value or throw InvalidCastException for incorrect type.

  • Explicit operators to convert XLCellValue to a concrete type. It is an equivalent of Get* methods.

  • TryConvert methods to try to get value of a specific type, even if the value is of a different type.

Public Functions

Blank GetBlank ()

If the value is of type XLDataType.Blank, return Blank.Value, otherwise throw InvalidCastException.

Boolean GetBoolean ()

If the value is of type XLDataType.Boolean, return logical, otherwise throw InvalidCastException.

Double GetNumber ()

If the value is of type XLDataType.Number, return number, otherwise throw InvalidCastException.

String GetText ()

If the value is of type XLDataType.Text, return text, otherwise throw InvalidCastException.

XLError GetError ()

If the value is of type XLDataType.Error, return error, otherwise throw InvalidCastException.

DateTime GetDateTime ()

If the value is of type XLDataType.DateTime, return date time, otherwise throw InvalidCastException.

TimeSpan GetTimeSpan ()

If the value is of type XLDataType.TimeSpan, return time span, otherwise throw InvalidCastException.

double GetUnifiedNumber ()

Get a number, either directly from type number or from serialized time span or serialized date time.

Throws InvalidCastException

If type is not XLDataType.Number or XLDataType.DateTime or XLDataType.TimeSpan.

override string ToString ()

Return text representation of a value in current culture.

string ToString (CultureInfo culture)

Return text representation of a value in the specified culture.

bool TryGetText (out string value)

Get a value, if it is a XLDataType.Text.

Return

True if value was retrieved, false otherwise.

bool TryConvert (out Blank value)

Try to convert the value to a XLDataType.Blank and return it. Method succeeds, when value is

bool TryConvert (out Boolean value)

Try to convert the value to a XLDataType.Boolean and return it. Method succeeds, when value is

  • Type XLDataType.Boolean.

  • Type XLDataType.Number, then the value of 0 means false and any other value is true.

  • Type XLDataType.Text and the value is TRUE or FALSE (case insensitive). Note that calc engine generally doesn’t coerce text to logical (e.g. arithmetic operations), though it happens in most function arguments (e.g. IF or AND).

bool TryConvert (out Double value, CultureInfo culture)

Try to convert the value to a XLDataType.Number and return it.

  • Double value - return the value.

  • Boolean value - return the 0 for TRUE and 1 for FALSE.

  • Text value - use the VALUE semantic to convert a text to a number.

  • DateTime value - return the serial date time number.

  • TimeSpan value - return the serial time span value.

Note that the coercion is current culture specific (e.g. decimal separators can differ).

Param value

The converted value. Result is never infinity or NaN.

Param culture

The culture used to convert the value for texts.

bool TryConvert (out DateTime value)

Try to convert the value to a DateTime and return it. Method succeeds, when value is

bool TryConvert (out TimeSpan value, CultureInfo culture)

Try to convert the value to a TimeSpan and return it. Method succeeds, when value is

Param value

The converted value.

Param culture

The culture used to get time and decimal separators.

Public Members

bool IsBlank = > Type == XLDataType.Blank

Is the type of value Blank?

bool IsBoolean = > Type == XLDataType.Boolean

Is the type of value XLDataType.Boolean?

bool IsNumber = > Type == XLDataType.Number

Is the type of value XLDataType.Number?

bool IsText = > Type == XLDataType.Text

Is the type of value XLDataType.Text?

bool IsError = > Type == XLDataType.Error

Is the type of value XLDataType.Error?

bool IsDateTime = > Type == XLDataType.DateTime

Is the type of value XLDataType.DateTime?

bool IsTimeSpan = > Type == XLDataType.TimeSpan

Is the type of value XLDataType.TimeSpan?

bool IsUnifiedNumber = > IsNumber || IsDateTime || IsTimeSpan

Is the value XLDataType.Number or XLDataType.DateTime or XLDataType.TimeSpan.

Properties

XLDataType Type { get; set; }

Type of the value.

class XLCFBaseConverter
class XLCFCellIsConverter : public IXLCFConverter
class XLCFColorScaleConverter : public IXLCFConverter
class XLCFColorScaleMax : public IXLCFColorScaleMax
class XLCFColorScaleMid : public IXLCFColorScaleMid
class XLCFColorScaleMin : public IXLCFColorScaleMin
class XLCFContainsConverter : public IXLCFConverter
class XLCFConverters
class XLCFConvertersExtension
class XLCFDataBarConverter : public IXLCFConverter
class XLCFDataBarConverterExtension : public IXLCFConverterExtension
class XLCFDataBarMax : public IXLCFDataBarMax
class XLCFDataBarMin : public IXLCFDataBarMin
class XLCFDatesOccurringConverter : public IXLCFConverter
class XLCFEndsWithConverter : public IXLCFConverter
class XLCFIconSet : public IXLCFIconSet
class XLCFIconSetConverter : public IXLCFConverter
class XLCFIsBlankConverter : public IXLCFConverter
class XLCFIsErrorConverter : public IXLCFConverter
class XLCFNotBlankConverter : public IXLCFConverter
class XLCFNotContainsConverter : public IXLCFConverter
class XLCFNotErrorConverter : public IXLCFConverter
class XLCFStartsWithConverter : public IXLCFConverter
class XLCFTopConverter : public IXLCFConverter
class XLCFUniqueConverter : public IXLCFConverter
class XLChart : public ClosedXML::Excel::XLDrawing<IXLChart>, public IXLChart
class XLCharts : public IXLCharts
class XLClearOptionsExtensions
class XLColor
struct XLColorKey : public IEquatable<XLColorKey>
class XLColumn : public XLRangeBase, public IXLColumn

Public Functions

XLColumn (XLWorksheet worksheet, Int32 column)

The direct constructor should only be used in XLWorksheet.RangeFactory.

IXLColumn AddVerticalPageBreak ()

Adds a vertical page break after this column.

class XLColumns : public XLStylizedBase, public IXLColumns, public IXLStylized

Public Functions

XLColumns (XLWorksheet worksheet, XLStyleValue defaultStyle = null, IEnumerable<XLColumn> lazyEnumerable = null)

Create a new instance of XLColumns.

Param worksheet

If worksheet is specified it means that the created instance represents all columns on a worksheet so changing its width will affect all columns.

Param defaultStyle

Default style to use when initializing child entries.

Param lazyEnumerable

A predefined enumerator of XLColumn to support lazy initialization.

IXLColumns AddVerticalPageBreaks ()

Adds a vertical page break after this column.

class XLColumnsCollection : public IDictionary<Int32, XLColumn>
class XLComment : public ClosedXML::Excel::XLFormattedText<IXLComment>, public IXLComment
class XLConditionalFormat : public XLStylizedBase, public IXLConditionalFormat, public IXLStylized
class XLConditionalFormats : public IXLConditionalFormats

Public Functions

void ReorderAccordingToOriginalPriority ()

Reorders the according to original priority. Done during load process

class XLConstants
class PivotTable
class XLCustomFilteredColumn : public IXLCustomFilteredColumn
class XLCustomProperties : public IXLCustomProperties, public System::Collections::IEnumerable<IXLCustomProperty>
class XLCustomProperty : public IXLCustomProperty
class XLDataValidation : public IXLDataValidation

Public Functions

void AddRange (IXLRange range)

Add a range to the collection of ranges this rule applies to. If the specified range does not belong to the worksheet of the data validation rule it is transferred to the target worksheet.

Param range

A range to add.

void AddRanges (IEnumerable<IXLRange> ranges)

Add a collection of ranges to the collection of ranges this rule applies to. Ranges that do not belong to the worksheet of the data validation rule are transferred to the target worksheet.

Param ranges

Ranges to add.

void ClearRanges ()

Detach data validation rule of all ranges it applies to.

bool RemoveRange (IXLRange range)

Remove the specified range from the collection of range this rule applies to.

Param range

A range to remove.

class XLDataValidations : public IXLDataValidations

Public Functions

IEnumerable<IXLDataValidation> GetAllInRange (IXLRangeAddress rangeAddress)

Get all data validation rules applied to ranges that intersect the specified range.

bool TryGet (IXLRangeAddress rangeAddress, out IXLDataValidation dataValidation)

Get the data validation rule for the range with the specified address if it exists.

Param rangeAddress

A range address.

Param dataValidation

Data validation rule which ranges collection includes the specified address. The specified range should be fully covered with the data validation rule. For example, if the rule is applied to ranges A1:A3,C1:C3 then this method will return True for ranges A1:A3, C1:C2, A2:A3, and False for ranges A1:C3, A1:C1, etc.

Return

True is the data validation rule was found, false otherwise.

class XLDateCriteria : public XLValidationCriteria
class XLDateTimeGroupFilteredColumn : public IXLDateTimeGroupFilteredColumn
class XLDecimalCriteria : public XLValidationCriteria
class XLDictionary<T> : public Dictionary<Int32, T>
class XLDrawing<T> : public ClosedXML::Excel::IXLDrawing<T>

Subclassed by XLChart

class XLDrawingAlignment : public IXLDrawingAlignment
class XLDrawingColorsAndLines : public IXLDrawingColorsAndLines
class XLDrawingFont : public IXLDrawingFont
class XLDrawingMargins : public IXLDrawingMargins
class XLDrawingPosition : public IXLDrawingPosition
class XLDrawingProperties : public IXLDrawingProperties
class XLDrawingProtection : public IXLDrawingProtection
class XLDrawingSize : public IXLDrawingSize
class XLDrawingStyle : public IXLDrawingStyle
class XLDrawingWeb : public IXLDrawingWeb
class XLFileSharing : public IXLFileSharing
class XLFill : public IXLFill

Public Functions

XLFill (XLStyle style, XLFillValue value)

Create an instance of XLFill initializing it with the specified value.

Param style

Style to attach the new instance to.

Param value

Style value to use.

struct XLFillKey : public IEquatable<XLFillKey>
class XLFillValue
class XLFilter
class XLFilterColumn : public IXLFilterColumn
class XLFilterConnector : public IXLFilterConnector
class XLFilteredColumn : public IXLFilteredColumn
class XLFont : public IXLFont

Public Functions

XLFont (XLStyle style, XLFontValue value)

Create an instance of XLFont initializing it with the specified value.

Param style

Style to attach the new instance to.

Param value

Style value to use.

struct XLFontKey : public IEquatable<XLFontKey>
class XLFontValue
class XLFormattedText<T> : public ClosedXML::Excel::IXLFormattedText<T>

Subclassed by XLComment, XLRichText

class XLFormula
class XLHeaderFooter : public IXLHeaderFooter
class XLHelper

Common methods

Public Static Functions

int GetColumnNumberFromLetter (string columnLetter)

Gets the column number of a given column letter.

Param columnLetter

The column letter to translate into a column number.

string GetColumnLetterFromNumber (int columnNumber, bool trimToAllowed = false)

Gets the column letter of a given column number.

Param columnNumber

The column number to translate into a column letter.

Param trimToAllowed

if set to true the column letter will be restricted to the allowed range.

string CreateSafeSheetName (string nameProposal, char replaceChar = ' ')

Creates a valid sheet name, which conforms to the following rules. A sheet name: is never null, has minimum length of 1 and maximum length of 31, doesn’t contain special chars: (: 0x0000 0x0003 / \ ? * ] [). Sheet names must not begin or end with ‘ (apostrophe)

Param nameProposal

can be any string, will be truncated if necessary, allowed to be null

Param replaceChar

the char to replace invalid characters.

Return

a valid string, “empty” if too short, “null” if null

void ValidateSheetName (String sheetName)

Validates the name of the sheet. The character count MUST be greater than or equal to 1 and less than or equal to 31. The string MUST NOT contain the any of the following characters:

  • 0x0000

  • 0x0003

  • colon (:)

  • backslash(\)

  • asterisk(*)

  • question mark(?)

  • forward slash(/)

  • opening square bracket([)

  • closing square bracket(]) The string MUST NOT begin or end with the single quote(’) character.

Param sheetName

Name of the sheet.

Throws ArgumentException

class XLHFItem : public IXLHFItem
class XLHFText
class XLIdManager
class XLMargins : public IXLMargins
class XLNamedRange : public IXLNamedRange

Properties

bool IsValid { get; set; }

Checks if the named range contains invalid references (#REF!).

class XLNamedRanges : public IXLNamedRanges

Public Functions

IEnumerable<IXLNamedRange> ValidNamedRanges ()

Returns a subset of named ranges that do not have invalid references.

IEnumerable<IXLNamedRange> InvalidNamedRanges ()

Returns a subset of named ranges that do have invalid references.

class XLNumberFormat : public IXLNumberFormat

Public Functions

XLNumberFormat (XLStyle style, XLNumberFormatValue value)

Create an instance of XLNumberFormat initializing it with the specified value.

Param style

Style to attach the new instance to.

Param value

Style value to use.

struct XLNumberFormatKey : public IEquatable<XLNumberFormatKey>
class XLNumberFormatValue

Properties

int NumberFormatId { get; set; }

Id of the number format. Every workbook has XLConstants.NumberOfBuiltInStyles built-int formats that start at 0 (General format). The built-int formats are not explicitly written and might differ depending on culture. Custom number formats have a valid Format and the id is -1.

class XLOutline : public IXLOutline
class XLPageSetup : public IXLPageSetup
class XLPhonetic : public IXLPhonetic
class XLPhonetics : public IXLPhonetics
class XLPivotField : public IXLPivotField
class XLPivotFields : public IXLPivotFields
class XLPivotFieldStyleFormats : public IXLPivotFieldStyleFormats
class XLPivotStyleFormat : public IXLPivotStyleFormat

Subclassed by XLPivotValueStyleFormat

class XLPivotStyleFormats : public IXLPivotStyleFormats
class XLPivotTable : public IXLPivotTable
class XLPivotTables : public IXLPivotTables
class XLPivotTableStyleFormats : public IXLPivotTableStyleFormats
class XLPivotValue : public IXLPivotValue
class XLPivotValueCombination : public IXLPivotValueCombination
class XLPivotValueFormat : public IXLPivotValueFormat
class XLPivotValues : public IXLPivotValues
class XLPivotValueStyleFormat : public XLPivotStyleFormat, public IXLPivotValueStyleFormat
class XLPredefinedFormat

Reference point of date/number formats available. See more at: https://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.numberingformat.aspx

Properties

int General { get; set; }

General

class XLPrintAreas : public IXLPrintAreas
class XLProtection : public IXLProtection

Public Functions

XLProtection (XLStyle style, XLProtectionValue value)

Create an instance of XLProtection initializing it with the specified value.

Param style

Style to attach the new instance to.

Param value

Style value to use.

class XLProtectionAlgorithm
struct XLProtectionKey : public IEquatable<XLProtectionKey>
class XLProtectionValue
class XLRange : public XLRangeBase, public IXLRange

Subclassed by XLTable, XLTableRange

struct XLRangeAddress : public IXLRangeAddress, public IEquatable<XLRangeAddress>

Public Functions

XLRangeAddress Normalize ()

Lead a range address to a normal form - when FirstAddress points to the top-left address and LastAddress points to the bottom-right address.

class XLRangeBase : public XLStylizedBase, public IXLRangeBase, public IXLStylized

Subclassed by XLColumn, XLRange, XLRangeColumn, XLRangeRow, XLRow, XLWorksheet

Public Functions

IEnumerable<XLCellValue> CellValues ()

Return the collection of cell values not initializing empty cells.

class XLRangeColumn : public XLRangeBase, public IXLRangeColumn

Public Functions

XLRangeColumn (XLRangeParameters rangeParameters)

The direct constructor should only be used in XLWorksheet.RangeFactory.

class XLRangeColumns : public XLStylizedBase, public IXLRangeColumns, public IXLStylized
class XLRangeConsolidationEngine

Engine for ranges consolidation. Supports IXLRanges including ranges from either one or multiple worksheets.

class XLRangeFactory
struct XLRangeKey : public IEquatable<XLRangeKey>

Public Functions

bool Equals (XLRangeKey other)

Indicates whether the current object is equal to another object of the same type.

Param other

An object to compare with this object.

Return

true if the current object is equal to the other parameter; otherwise, false.

override bool Equals (object obj)

Indicates whether this instance and a specified object are equal.

Param obj

Another object to compare to.

Return

true if obj and this instance are the same type and represent the same value; otherwise, false.

override int GetHashCode ()

Returns the hash code for this instance.

Return

A 32-bit signed integer that is the hash code for this instance.

class XLRangeParameters
class XLRangeRow : public XLRangeBase, public IXLRangeRow

Subclassed by XLTableRow

Public Functions

XLRangeRow (XLRangeParameters rangeParameters)

The direct constructor should only be used in XLWorksheet.RangeFactory.

class XLRangeRows : public XLStylizedBase, public IXLRangeRows, public IXLStylized
class XLRanges : public XLStylizedBase, public IXLRanges, public IXLStylized

Public Functions

void RemoveAll (Predicate<IXLRange> match = null, bool releaseEventHandlers = true)

Removes ranges matching the criteria from the collection, optionally releasing their event handlers.

Param match

Criteria to filter ranges. Only those ranges that satisfy the criteria will be removed. Null means the entire collection should be cleared.

Param releaseEventHandlers

Specify whether or not should removed ranges be unsubscribed from row/column shifting events. Until ranges are unsubscribed they cannot be collected by GC.

IEnumerable<IXLRange> GetIntersectedRanges (IXLRangeAddress rangeAddress)

Filter ranges from a collection that intersect the specified address. Is much more efficient that using Linq expression .Where().

IEnumerable<IXLRange> GetIntersectedRanges (IXLAddress address)

Filter ranges from a collection that intersect the specified address. Is much more efficient that using Linq expression .Where().

class XLRichString : public IXLRichString
class XLRichText : public ClosedXML::Excel::XLFormattedText<IXLRichText>, public IXLRichText
class XLRow : public XLRangeBase, public IXLRow

Public Functions

XLRow (XLWorksheet worksheet, Int32 row)

The direct constructor should only be used in XLWorksheet.RangeFactory.

class XLRows : public XLStylizedBase, public IXLRows, public IXLStylized

Public Functions

XLRows (XLWorksheet worksheet, XLStyleValue defaultStyle = null, IEnumerable<XLRow> lazyEnumerable = null)

Create a new instance of XLRows.

Param worksheet

If worksheet is specified it means that the created instance represents all rows on a worksheet so changing its height will affect all rows.

Param defaultStyle

Default style to use when initializing child entries.

Param lazyEnumerable

A predefined enumerator of XLRow to support lazy initialization.

class XLRowsCollection : public IDictionary<Int32, XLRow>
struct XLSheetPoint : public IEquatable<XLSheetPoint>
class XLSheetProtection : public IXLSheetProtection
struct XLSheetRange : public IEquatable<XLSheetRange>
class XLSheetView : public IXLSheetView
class XLSortElement : public IXLSortElement
class XLSortElements : public IXLSortElements
class XLSparkline : public IXLSparkline

Public Functions

XLSparkline (IXLSparklineGroup sparklineGroup, IXLCell cell, IXLRange sourceData)

Create a new sparkline

Param sparklineGroup

The sparkline group to add the sparkline to

Param cell

The cell to place the sparkline in

Param sourceData

The range the sparkline gets data from

class XLSparklineGroup : public IXLSparklineGroup

Public Functions

XLSparklineGroup (IXLWorksheet targetWorksheet, IXLSparklineGroup copyFrom)

Add a new sparkline group copied from an existing sparkline group to the specified worksheet

Param targetWorksheet

The worksheet the sparkline group is being added to

Param copyFrom

The sparkline group to copy from

Return

The new sparkline group added

XLSparklineGroup (IXLWorksheet targetWorksheet, string locationAddress, string sourceDataAddress)

Add a new sparkline group copied from an existing sparkline group to the specified worksheet

Return

The new sparkline group added

XLSparklineGroup (IXLCell location, IXLRange sourceData)

Add a new sparkline group copied from an existing sparkline group to the specified worksheet

Return

The new sparkline group added

XLSparklineGroup (IXLRange locationRange, IXLRange sourceDataRange)

Add a new sparkline group copied from an existing sparkline group to the specified worksheet

Return

The new sparkline group added

IXLSparkline Add (IXLCell location, IXLRange sourceData)

Add a sparkline to the group.

Param location

The cell to add sparklines to. If it already contains a sparkline it will be replaced.

Param sourceData

The range the sparkline gets data from

Return

A newly created sparkline.

void CopyFrom (IXLSparklineGroup sparklineGroup)

Copy the details from a specified sparkline group

Param sparklineGroup

The sparkline group to copy from

IXLSparklineGroup CopyTo (IXLWorksheet targetSheet)

Copy this sparkline group to the specified worksheet

Param targetSheet

The worksheet to copy this sparkline group to

void Remove (IXLCell cell)

Remove all sparklines in the specified cell from this group

Param cell

The cell to remove sparklines from

void Remove (IXLSparkline sparkline)

Remove the sparkline from this group

Param sparkline

void RemoveAll ()

Remove all sparklines from this group

Properties

IXLWorksheet Worksheet { get; set; }

The worksheet this sparkline group is associated with

class XLSparklineGroups : public IXLSparklineGroups

Public Functions

IXLSparklineGroup Add (IXLSparklineGroup sparklineGroup)

Add the sparkline group to the collection.

Param sparklineGroup

The sparkline group to add to the collection

Return

The same sparkline group

IXLSparklineGroup AddCopy (IXLSparklineGroup sparklineGroupToCopy, IXLWorksheet targetWorksheet)

Add a copy of an existing sparkline group to the specified worksheet

Param sparklineGroupToCopy

The sparkline group to copy

Param targetWorksheet

The worksheet the sparkline group is being added to

Return

The new sparkline group added

void CopyTo (IXLWorksheet targetSheet)

Copy this sparkline group to a different worksheet

Param targetSheet

The worksheet to copy the sparkline group to

IXLSparkline GetSparkline (IXLCell cell)

Search for the first sparkline that is in the specified cell

Param cell

The cell to find the sparkline for

Return

The sparkline in the cell or null if no sparklines are found

IEnumerable<IXLSparkline> GetSparklines (IXLRangeBase searchRange)

Find all sparklines located in a given range

Param searchRange

The range to search

Return

The sparkline in the cell or null if no sparklines are found

void Remove (IXLCell cell)

Remove all sparklines in the specified cell

Param cell

The cell to remove sparklines from

void Remove (IXLSparklineGroup sparklineGroup)

Remove the sparkline group from the worksheet

Param sparklineGroup

The sparkline group to remove

void RemoveAll ()

Remove all sparkline groups and their contents from the worksheet.

class XLSparklineHorizontalAxis : public IXLSparklineHorizontalAxis
class XLSparklineStyle : public IXLSparklineStyle, public IEquatable<XLSparklineStyle>

Public Functions

bool Equals (XLSparklineStyle other)

Indicates whether the current object is equal to another object of the same type.

Param other

An object to compare with this object.

Return

true if the current object is equal to the other other parameter; otherwise, false.

override bool Equals (object obj)

Determines whether the specified object is equal to the current object.

Param obj

The object to compare with the current object.

Return

true if the specified object is equal to the current object; otherwise, false.

override int GetHashCode ()

Serves as the default hash function.

Return

A hash code for the current object.

Public Static Functions

bool operator!= (XLSparklineStyle left, XLSparklineStyle right)

Returns a value that indicates whether two T:ClosedXML.Excel.XLSparklineStyle objects have different values.

Param left

The first value to compare.

Param right

The second value to compare.

Return

true if left and right are not equal; otherwise, false.

bool operator== (XLSparklineStyle left, XLSparklineStyle right)

Returns a value that indicates whether the values of two T:ClosedXML.Excel.XLSparklineStyle objects are equal.

Param left

The first value to compare.

Param right

The second value to compare.

Return

true if the left and right parameters have the same value; otherwise, false.

class XLSparklineTheme
class XLSparklineVerticalAxis : public IXLSparklineVerticalAxis
class XLStyle : public IXLStyle
struct XLStyleKey : public IEquatable<XLStyleKey>
class XLStyleValue
class XLStylizedBase : public IXLStylized

Base class for any workbook element that has or may have a style.

Subclassed by XLCell, XLCells, XLColumns, XLConditionalFormat, XLRangeBase, XLRangeColumns, XLRangeRows, XLRanges, XLRows, XLStylizedEmpty, XLTableRows

Properties

IXLStyle Style { get; set; }

Editable style of the workbook element. Modification of this property DOES affect styles of child objects as well - they will be changed accordingly. Accessing this property causes a new XLStyle instance generated so use this property with caution. If you need only _read_ the style consider using StyleValue property instead.

IXLStyle InnerStyle { get; set; }

Editable style of the workbook element. Modification of this property DOES NOT affect styles of child objects. Accessing this property causes a new XLStyle instance generated so use this property with caution. If you need only _read_ the style consider using StyleValue property instead.

class ReferenceEqualityComparer<T> : public IEqualityComparer<T>
class XLStylizedEmpty : public XLStylizedBase, public IXLStylized
class XLTable : public XLRange, public IXLTable

Public Functions

XLTable (XLRangeParameters xlRangeParameters)

The direct constructor should only be used in XLWorksheet.RangeFactory.

class XLTableField : public IXLTableField
class XLTableRange : public XLRange, public IXLTableRange
class XLTableRow : public XLRangeRow, public IXLTableRow
class XLTableRows : public XLStylizedBase, public IXLTableRows, public IXLStylized
class XLTables : public IXLTables
class XLTableTheme
class XLTextLengthCriteria : public XLWholeNumberCriteriaBase
class XLTheme : public IXLTheme
class XLTimeCriteria : public XLValidationCriteria
class XLValidationCriteria : public IXLValidationCriteria

Subclassed by XLDateCriteria, XLDecimalCriteria, XLTimeCriteria, XLWholeNumberCriteriaBase

class XLWholeNumberCriteria : public XLWholeNumberCriteriaBase
class XLWholeNumberCriteriaBase : public XLValidationCriteria

Subclassed by XLTextLengthCriteria, XLWholeNumberCriteria

class XLWorkbook : public IXLWorkbook

Public Functions

void Save ()

Saves the current workbook.

void Save (Boolean validate, Boolean evaluateFormulae = false)

Saves the current workbook and optionally performs validation

void SaveAs (String file)

Saves the current workbook to a file.

void SaveAs (String file, Boolean validate, Boolean evaluateFormulae = false)

Saves the current workbook to a file and optionally validates it.

void SaveAs (Stream stream)

Saves the current workbook to a stream.

void SaveAs (Stream stream, Boolean validate, Boolean evaluateFormulae = false)

Saves the current workbook to a stream and optionally validates it.

IEnumerable<IXLCell> Search (String searchText, CompareOptions compareOptions = CompareOptions.Ordinal, Boolean searchFormulae = false)

Searches the cells’ contents for a given piece of text

Param searchText

The search text.

Param compareOptions

The compare options.

Param searchFormulae

if set to true search formulae instead of cell values.

XLWorkbook ()

Creates a new Excel workbook.

XLWorkbook (String file)

Opens an existing workbook from a file.

Param file

The file to open.

XLWorkbook (Stream stream)

Opens an existing workbook from a stream.

Param stream

The stream to open.

XLCellValue Evaluate (String expression)

Evaluate a formula expression.

Param expression

Formula expression to evaluate.

Throws MissingContextException

If the expression contains a function that requires a context (e.g. current cell or worksheet).

void RecalculateAllFormulas ()

Force recalculation of all cell formulas.

Properties

XLCellSetValueBehavior CellSetValueBehavior { get; set; }

Behavior for IXLCell.set_Value

IXLWorksheets Worksheets { get; set; }

Gets an object to manipulate the worksheets.

IXLNamedRanges NamedRanges { get; set; }

Gets an object to manipulate this workbook’s named ranges.

IXLTheme Theme { get; set; }

Gets an object to manipulate this workbook’s theme.

IXLStyle Style { get; set; }

Gets or sets the default style for the workbook.

All new worksheets will use this style.

Double RowHeight { get; set; }

Gets or sets the default row height for the workbook.

All new worksheets will use this row height.

Double ColumnWidth { get; set; }

Gets or sets the default column width for the workbook.

All new worksheets will use this column width.

IXLPageSetup PageOptions { get; set; }

Gets or sets the default page options for the workbook.

All new worksheets will use these page options.

IXLOutline Outline { get; set; }

Gets or sets the default outline options for the workbook.

All new worksheets will use these outline options.

XLWorkbookProperties Properties { get; set; }

Gets or sets the workbook’s properties.

XLCalculateMode CalculateMode { get; set; }

Gets or sets the workbook’s calculation mode.

XLReferenceStyle ReferenceStyle { get; set; }

Gets or sets the workbook’s reference style.

Public Static Functions

XLCellValue EvaluateExpr (String expression)

Evaluate a formula and return a value. Formulas with references don’t work and culture used for conversion is invariant.

class XLWorkbookProperties
class XLWorkbookProtection : public IXLWorkbookProtection
class XLWorksheet : public XLRangeBase, public IXLWorksheet

Public Functions

void RecalculateAllFormulas ()

Force recalculation of all cell formulas.

XLRangeRow RangeRow (XLRangeAddress address, IXLStyle defaultStyle = null)

Get a range row from the shared repository or create a new one.

Param address

Address of range row.

Param defaultStyle

Style to apply. If null the worksheet’s style is applied.

Return

Range row with the specified address.

XLRangeColumn RangeColumn (XLRangeAddress address, IXLStyle defaultStyle = null)

Get a range column from the shared repository or create a new one.

Param address

Address of range column.

Param defaultStyle

Style to apply. If null the worksheet’s style is applied.

Return

Range column with the specified address.

Public Members

string LegacyDrawingId

Reference to a VML that contains notes, forms controls and so on. All such things are generally unified into a single legacy VML file, set during load/save.

class XLWorksheetInternals : public IDisposable
class XLWorksheets : public IXLWorksheets, public IEnumerable<XLWorksheet>
namespace Caching
interface IXLRepository<Tkey, Tvalue> : public IXLRepository, public System::Collections::IEnumerable<Tvalue>

Public Functions

void Clear ()

Clear the repository;

Tvalue Store (ref Tkey key, Tvalue value)

Put the value into the repository under the specified key if there is no such key present.

Param key

Key to identify the value.

Param value

Value to put into the repository if key does not exist.

Return

Value stored in the repository under the specified key . If key already existed returned value may differ from the input one.

class XLAlignmentRepository : public ClosedXML::Excel::Caching::XLRepositoryBase<XLAlignmentKey, XLAlignmentValue>
class XLBorderRepository : public ClosedXML::Excel::Caching::XLRepositoryBase<XLBorderKey, XLBorderValue>
class XLColorRepository : public ClosedXML::Excel::Caching::XLRepositoryBase<XLColorKey, XLColor>
class XLFillRepository : public ClosedXML::Excel::Caching::XLRepositoryBase<XLFillKey, XLFillValue>
class XLFontRepository : public ClosedXML::Excel::Caching::XLRepositoryBase<XLFontKey, XLFontValue>
class XLNumberFormatRepository : public ClosedXML::Excel::Caching::XLRepositoryBase<XLNumberFormatKey, XLNumberFormatValue>
class XLProtectionRepository : public ClosedXML::Excel::Caching::XLRepositoryBase<XLProtectionKey, XLProtectionValue>
class XLRangeRepository : public ClosedXML::Excel::Caching::XLWorkbookElementRepositoryBase<XLRangeKey, XLRangeBase>
class XLRepositoryBase<Tkey, Tvalue> : public IXLRepository, public XLRepositoryBase, public ClosedXML::Excel::Caching::IXLRepository<Tkey, Tvalue>

Public Functions

bool ContainsKey (ref Tkey key, out Tvalue value)

Check if the specified key is presented in the repository.

Param key

Key to look for.

Param value

Value from the repository stored under specified key or null if key does not exist or the entry under this key has already bee GCed.

Return

True if entry exists and alive, false otherwise.

Tvalue Store (ref Tkey key, Tvalue value)

Put the entity into the repository under the specified key if no other entity with the same key is presented.

Param key

Key to identify the entity.

Param value

Entity to store.

Return

Entity that is stored in the repository under the specified key (it can be either the value or another entity that has been added to the repository before.)

IEnumerator<Tvalue> GetEnumerator ()

Enumerate items in repository removing “dead” entries.

class XLStyleRepository : public ClosedXML::Excel::Caching::XLRepositoryBase<XLStyleKey, XLStyleValue>
class XLWorkbookElementRepositoryBase<Tkey, Tvalue> : public ClosedXML::Excel::Caching::XLRepositoryBase<Tkey, Tvalue>

Base repository for XLWorkbook elements.

Subclassed by XLRangeRepository

namespace CalcEngine

Enums

enum UnaryOp

Values:

Add
Subtract
Percentage
SpillRange
ImplicitIntersection
enum BinaryOp

Values:

Concat
Add
Sub
Mult
Div
Exp
Lt
Lte
Eq
Neq
Gte
Gt
Range
Union
Intersection
enum ReferenceItemType

Values:

Cell
VRange
HRange
enum FormulaFlags

Flags that contain some useful information about a formula (mostly derived from flags in functions).

Values:

None

Basic formula that takes an input and returns output that is determined solely by the input. No side effects.

Volatile

Formula contains a function whose value can be different each time the function is called, even if arguments and workbook are same.

TODAY, RAND

SideEffect

Formula that has a side effects beside returning the value.

HYPERLINK changes the content of a cell in a workbook.

HasSubtotal

Formula contains a reference to the SUBTOTAL function.

Performance optimization, so a formula with SUBTOTAL doesn’t have to check each dependent cell each time it is evaluated.

enum FunctionFlags

Function flags that indicate what does function do. It is used by CalcEngine for calculation chain and formula execution.

Values:

Scalar

Function that takes an input and returns an output. It is designed for a single value arguments. If scalar function is used for array formula or dynamic array formula, the function is called for each element separately.

Range

Non-scalar function. At least one of arguments of the function accepts a range. It means that implicit intersection works differently.

SideEffect

Function has side effects, e.g. it changes something.

HYPERLINK

enum AllowRange

Which parameters of a function allow ranges. That is important for implicit intersection.

Values:

None

None of parameters allow ranges.

All

All parameters allow ranges.

Except

All parameters except marked ones allow ranges.

Only

Only marked parameters allow ranges.

Functions

delegate ScalarValue BinaryFunc (in ScalarValue lhs, in ScalarValue rhs, CalcContext ctx)
delegate AnyValue CalcEngineFunction (CalcContext ctx, Span<AnyValue> arg)
delegate object LegacyCalcEngineFunction (List<Expression> parms)

Delegate that represents CalcEngine functions.

Param parms

List of Expression objects that represent the parameters to be used in the function call.

Return

The function result.

struct AnyValue

A discriminated union representing any value that can be passed around in the formula evaluation.

Public Functions

bool TryPickArea (out XLRangeAddress area, out XLError error)

Try to get a reference that is a one area from the value.

Param area

The found area.

Param error

Original error, if the value is error, #VALUE! if type is not a reference or #REF! if more than one area in the reference.

Return

True if area could be determined, false otherwise.

AnyValue ImplicitIntersection (CalcContext context)

Implicit intersection for arguments of functions that don’t accept range as a parameter (Excel 2016).

Return

Unchanged value for anything other than reference. Reference is changed into a single cell/#VALUE!

Public Static Functions

AnyValue ReferenceRange (in AnyValue left, in AnyValue right, CalcContext ctx)

Create a new reference that has one area that contains both operands or #VALUE! if not possible.

AnyValue ReferenceUnion (in AnyValue left, in AnyValue right)

Create a new reference by combining areas of both arguments. Areas of the new reference can overlap = some overlapping cells might be counted multiple times (SUM((A1;A1)) = 2 if A1 is 1).

Public Static Attributes

readonly AnyValue Blank = new(BlankValue, default, default, default, default, default, default)

A value of a blank cell or missing argument. Conversion methods mostly treat blank like 0 or an empty string.

class Array : public System::Collections::IEnumerable<ScalarValue>

A base class for an 2D array. Every array is at least 1x1.

Subclassed by ConstArray, NumberArray, ReferenceArray, ScalarArray

Public Functions

IEnumerator<ScalarValue> GetEnumerator ()

An iterator over all elements of an array, from top to bottom, from left to right.

Array Apply (Func<ScalarValue, ScalarValue> op)

Return a new array that was created by applying a function to each element of the array.

Array Apply (Array rightArray, BinaryFunc func, CalcContext ctx)

Return a new array that was created by applying a function to each element of the left and right array. Arrays can have different size and missing values are replaced by #N/A.

Properties

abstract int Width { get; set; }

Width of the array, at least 1.

abstract int Height { get; set; }

Height of the array, at least 1.

y, int x] { get; set; }

Get a value at specified coordinate.

Param y

Uses 0-based notation.

Param x

Uses 0-based notation.

class ArrayNode : public ValueNode

AST node that contains a constant array. Array is at least 1x1.

class AstNode

Base class for all AST nodes. All AST nodes must be immutable.

Subclassed by FileNode, PrefixNode, ValueNode

Public Functions

abstract TResult Accept<TContext, TResult> (TContext context, IFormulaVisitor<TContext, TResult> visitor)

Method to accept a visitor (=call a method of visitor with correct type of the node).

class BinaryNode : public ValueNode

Binary expression, e.g. 1+2

class CalcContext

Public Members

XLWorkbook Workbook = > _workbook ?? throw new MissingContextException()

Worksheet of the cell the formula is calculating.

XLWorksheet Worksheet = > _worksheet ?? throw new MissingContextException()

Worksheet of the cell the formula is calculating.

IXLAddress FormulaAddress = > _formulaAddress ?? throw new MissingContextException()

Address of the calculated formula.

bool UseImplicitIntersection = > true

Excel 2016 and earlier doesn’t support dynamic array formulas (it used an array formulas instead). As a consequence, all arguments for scalar functions where passed through implicit intersection before calling the function.

Properties

CultureInfo Culture { get; set; }

A culture used for comparisons and conversions (e.g. text to number).

class CalcEngine

CalcEngine parses strings and returns Expression objects that can be evaluated.

This class has three extensibility points:

Use the RegisterFunction method to define custom functions.

Subclassed by XLCalcEngine

Public Functions

Formula Parse (string expression)

Parses a string into an Expression.

Param expression

String to parse.

Return

An Expression object that can be evaluated.

ScalarValue Evaluate (string expression, XLWorkbook wb = null, XLWorksheet ws = null, IXLAddress address = null)

Evaluates an expression.

If you are going to evaluate the same expression several times, it is more efficient to parse it only once using the Parse method and then using the Expression.Evaluate method to evaluate the parsed expression.

Param expression

Expression to evaluate.

Param wb

Workbook where is formula being evaluated.

Param ws

Worksheet where is formula being evaluated.

Param address

Address of formula.

Return

The value of the expression.

Properties

bool? CacheExpressions { get; set; }

Gets or sets whether the calc engine should keep a cache with parsed expressions.

class CalcEngineHelpers
class CalculationVisitor : public ClosedXML::Excel::CalcEngine::IFormulaVisitor<CalcContext, AnyValue>
class CellRangeReference : public IValueObject, public IEnumerable
class ConstArray : public Array

An array of scalar values.

class DateTimeParser
class DefaultFormulaVisitor<TContext> : public ClosedXML::Excel::CalcEngine::IFormulaVisitor<TContext, AstNode>

A default visitor that copies a formula.

class EmptyValueExpression : public Expression

Expression that represents an omitted parameter.

class Engineering
class Expression : public IComparable<Expression>

An adapter for legacy function implementations.

Subclassed by EmptyValueExpression, XObjectExpression

class ExpressionCache

Caches expressions based on their string representation. This saves parsing time.

Uses weak references to avoid accumulating unused expressions.

class ExpressionParseException : public Exception

The exception that is thrown when the strings to be parsed to an expression is invalid.

Public Functions

ExpressionParseException (string message)

Initializes a new instance of the ExpressionParseException class with a specified error message.

Param message

The message that describes the error.

class FileNode : public AstNode

AST node for an reference to an external file in a formula.

Properties

int? Numeric { get; set; }

If the file is references indirectly, numeric identifier of a file.

string Path { get; set; }

If a file is referenced directly, a path to the file on the disc/UNC/web link, .

class Financial
class Formula

A non-state representation of a formula that can be used by many cells.

Properties

string Text { get; set; }

Text of the formula.

class FormulaParser

A parser that takes a string and parses it into concrete syntax tree through XLParser and then to abstract syntax tree that is used to evaluate the formula.

Public Functions

Formula ConvertToAst (ParseTree cst)

Parse a tree into a CSt that also has AST.

class FractionParser

Parse a fraction for text-to-number type coercion.

class FunctionDefinition

Function definition class (keeps function name, parameter counts, and delegate).

class FunctionNode : public ValueNode

A function call, e.g. SIN(0.5).

Properties

string Name { get; set; }

Name of the function.

class FunctionRegistry

Public Functions

void RegisterFunction (string functionName, int minParams, int maxParams, CalcEngineFunction fn, FunctionFlags flags, AllowRange allowRanges = AllowRange.None, params int[] markedParams)

Add a function to the registry.

Param functionName

Name of function in formulas.

Param minParams

Minimum number of parameters.

Param maxParams

Maximum number of parameters.

Param fn

A delegate of a function that will be called when function is supposed to be evaluated.

Param flags

Flags that indicate some additional info about function.

Param allowRanges

Which parameters allow ranges to be argument. Useful for array formulas.

Param markedParams

Index of parameter that is marked, start from 0

interface IFormulaVisitor<in TContext, out TResult>

Subclassed by CalculationVisitor, DefaultFormulaVisitor< TContext >

interface IValueObject

Interface supported by external objects that have to return a value other than themselves (e.g. a cell range object should return the cell content instead of the range itself).

Subclassed by CellRangeReference

class Logical
class MathTrig
class NameNode : public ValueNode

A name node in the formula. Name can refers to a generic formula, in most cases a reference, but it can be any kind of calculation (e.g. A1+7).

Properties

PrefixNode Prefix { get; set; }

An optional prefix for reference item.

class NotSupportedNode : public ValueNode

An placeholder node for AST nodes that are not yet supported in ClosedXML.

class NumberArray : public Array

A special case of an array that is actually only numbers.

struct OneOf<T0, T1>
class PrefixNode : public AstNode

AST node for prefix of a reference in a formula. Prefix is a specification where to look for a reference.

  • Prefix specifies a Sheet - used for references in the local workbook.

  • Prefix specifies a FirstSheet and a LastSheet - 3D reference, references uses all sheets between first and last.

  • Prefix specifies a File, no sheet is specified - used for named ranges in external file.

  • Prefix specifies a File and a Sheet - references looks for its address in the sheet of the file.

Properties

FileNode File { get; set; }

If prefix references data from another file, can be empty.

string Sheet { get; set; }

Name of the sheet, without ! or escaped quotes. Can be empty in some cases (e.g. reference to a named range in an another file).

string FirstSheet { get; set; }

If the prefix is for 3D reference, name of first sheet. Empty otherwise.

string LastSheet { get; set; }

If the prefix is for 3D reference, name of the last sheet. Empty otherwise.

class Reference

Reference is a collection of cells in the workbook. It’s used in formula evaluation. Every reference has at least one cell.

Public Functions

Reference (List<XLRangeAddress> areas)

Ctor that reuses parameter to keep allocations low - don’t modify the collection after it is passed to ctor.

IEnumerable<ScalarValue> GetCellsValues (CalcContext ctx)

An iterator over all nonblank cells of the range. Some cells can be iterated over multiple times (e.g. a union of two ranges with overlapping cells).

OneOf<Reference, XLError> ImplicitIntersection (IXLAddress formulaAddress)

Do an implicit intersection of an address.

Param formulaAddress

Return

An address of the intersection or error if intersection failed.

class ReferenceArray : public Array

An array that retrieves its value directly from the worksheet without allocating extra memory.

class ReferenceNode : public ValueNode

AST node for a reference of an area in some sheet.

Properties

PrefixNode Prefix { get; set; }

An optional prefix for reference item.

string Address { get; set; }

An address of a reference that corresponds to Type. Always without sheet (that is in the prefix).

class ScalarArray : public Array

An array where all elements have same value.

class ScalarNode : public ValueNode

AST node that contains a blank, logical, number, text or an error value.

struct ScalarValue

A representation of a value as a discriminated union.

A bare bone copy of OneOf that can be more optimized:

  • readonly struct to get rid of defensive copies

  • struct can be smaller through offsets (based on NoBox)

  • allows to pass additional arguments to Match function to skip a need to instantiate a new lambda instance on each call and allow easier inlining.

Public Functions

OneOf<string, XLError> ToText (CultureInfo culture)

Convert value to text. Error is not convertible.

OneOf<double, XLError> ToNumber (CultureInfo culture)

Convert value to number. Error is not convertible.

bool HaveSameType (ScalarValue other)

Does this value have same type as the other one?

bool TryCoerceLogicalOrBlankOrNumberOrText (out Boolean value, out XLError error)

Get the logical value, if it is either blank (false), logical or number (0 = false, otherwise true)a text TRUE or FALSE (case insensitive).

Used for coercion in functions.

Public Static Attributes

readonly ScalarValue Blank = new(BlankValue, default, default, default, default)

A blank value of a scalar. It can behave as a 0 or empty string, depending on context.

A1+5 is a number 5, blank behaves as 0, A1 & "text" is a “text”, blank behaves as empty string.

class ScalarValueComparer : public IComparer<ScalarValue>

A comparer of a scalar logic. Each comparer with it’s logic can be accessed through a static property.

Properties

ScalarValueComparer SortIgnoreCase { get; set; } = new(StringComparer.OrdinalIgnoreCase)

Compare scalar values according to logic of “Sort” data in Excel, though texts are compared case insensitive.

Order is

  1. Type Number, from low to high

  2. Type Text, from low to high (non-culture specific, ordinal compare)

  3. Type Logical, FALSE, then TRUE.

  4. Type Error, all error values are treated as equal (at least they don’t change order).

  5. Type Blank, all values are treated as equal.

class Statistical
class StructuredReferenceNode : public ValueNode

Properties

PrefixNode Prefix { get; set; }

Can be empty if no prefix available.

class Tally : public IEnumerable<Object>
class Text
class TimeSpanParser

A parser of timespan format used by excel during coercion from text to number. TimeSpan parsing methods don’t allow for several features required by excel (e.g. seconds/minutes over 60, hours over 24). Parser can parse following formats from ECMA-376, Part 1, §18.8.30. due to standard text-to-number coercion:

  • Format 20 - h:mm.

  • Format 21 - h:mm:ss.

  • Format 47 - mm:ss.0 (format is incorrectly described as mmss.0 in the standard, but fixed in an implementation errata).

Timespan is never interpreted through format 45 (mm:ss), instead preferring the format 20 (h:mm). Timespan is never interpreted through format 46 ([h]:mm:ss], such values are covered by format 21 (h:mm:ss).

Note that the decimal fraction differs format 20 and 47, thus mere addition of decimal place means significantly different values. Parser also copies features of Excel, like whitespaces around a decimal place (10:20 . 5 is allowed).

20:30 is detected as format 20 and the first number is interpreted as hours, thus the serial time is 0.854167. 20:30.0 is detected as format 47 and the first number is interpreted as minutes, thus the serial time is 0.014236111.

class UnaryNode : public ValueNode

Unary expression, e.g. +123

class ValueNode : public AstNode

A base class for all AST nodes that can be evaluated to produce a value.

Subclassed by ArrayNode, BinaryNode, FunctionNode, NameNode, NotSupportedNode, ReferenceNode, ScalarNode, StructuredReferenceNode, UnaryNode

class XLAddressComparer : public IEqualityComparer<IXLAddress>
class XLCalcEngine : public CalcEngine

Public Functions

bool TryGetPrecedentCells (string expression, XLWorksheet worksheet, out ICollection<XLCell> uniqueCells)

Get cells that could be used as input of a formula, that could affect the calculated value.

Doesn’t work for ranges determined by reference functions and reference operators, e.g. A1:IF(SomeCondition,B1,C1).

Param expression

Formula to analyze.

Param worksheet

Worksheet used for ranges without sheet.

Param uniqueCells

All cells (including newly created blank ones) that are referenced in the formula.

Return

.

class XLRangeAddressComparer : public IEqualityComparer<IXLRangeAddress>
class XObjectExpression : public Expression, public IEnumerable

Expression that represents an external object.

namespace Exceptions
class FormulaErrorException : public Exception

An exception to propagate error from legacy expression function.

class MissingContextException : public InvalidOperationException

Evaluation of the formula needs an information that wasn’t available. That can happen if the formula is evaluated from methods like XLWorkbook.Evaluate(string). Causes vary, e.g. implicit intersection needs an address of the formula cell. Various methods in ClosedXML are missing different information, e.g. IXLWorksheet.Evaluate(string, string) has worksheet, but no cell address (=ranges will work, other things won’t).

namespace Functions
class ArgumentsExtensions

An extension methods

Public Static Functions

OneOf<TValue, XLError> Aggregate<TValue> (this Span<AnyValue> args, CalcContext ctx, TValue initialValue, OneOf<TValue, XLError> noElementsResult, Func<TValue, TValue, TValue> aggregate, Func<ScalarValue, CalcContext, OneOf<TValue, XLError>> convert, Func<ScalarValue, bool> includeCollectionElement = null)

Aggregate all values in the arguments of a function into a single value. If any value is error, return the error.

A lot of functions take all argument values and aggregate the values to a different value. These aggregation functions apply aggregation on each argument and if the argument is a collection (array/reference), the aggregation function is also applied to each element of the array/reference (e.g. SUM({1, 2}, 3) applies sum on each element of an array {1,2} and thus result is 1+2+3).

>

Tparam TValue

Type of the value that is being aggregated.

Param args

Arguments of a function. Method goes over all elements of the arguments.

Param ctx

Calculation context.

Param initialValue

Initial value of the accumulator. It is used as an input into the first call of aggregate .

Param noElementsResult

What should be the result of aggregation, if there are no elements. Common choices are XLError.IncompatibleValue or the initialValue .

Param aggregate

The aggregation function. First parameter is the accumulator, second parameter is the value of current element taken from convert . Make sure the method is static lambda to avoid useless allocations.

Param convert

A function that converts a scalar value of an element into the TValue or an error if it can’t be converted. Make sure the method is static lambda to avoid useless allocations.

Param includeCollectionElement

Some functions skip elements in a array/reference that would be accepted as an argument, e.g. SUM("1", {2,"4"}) is 3 - it converts string "3" to a number 3 in for root arguments, but omits element "4" in the array. This is a function that determines which elements to include and which to skip. If null, all elements of array are included and all values are treated same. Make sure the method is static lambda to avoid useless allocations.

class Database
class DateAndTime
class Information
class Lookup
class SignatureAdapter

A collection of adapter functions from a more a generic formula function to more specific ones.

class XLMath
class XLMatrix
namespace Cells
class XLCellValueComparer : public IEqualityComparer<XLCellValue>
namespace ContentManagers

Enums

enum XLSheetViewContents

Values:

Pane
Selection
PivotSelection
ExtensionList
enum XLWorksheetContents

Values:

SheetProperties
SheetDimension
SheetViews
SheetFormatProperties
Columns
SheetData
SheetCalculationProperties
SheetProtection
ProtectedRanges
Scenarios
AutoFilter
SortState
DataConsolidate
CustomSheetViews
MergeCells
PhoneticProperties
ConditionalFormatting
DataValidations
PrintOptions
PageMargins
PageSetup
HeaderFooter
RowBreaks
ColumnBreaks
CustomProperties
CellWatches
IgnoredErrors
SmartTags
Drawing
LegacyDrawing
LegacyDrawingHeaderFooter
DrawingHeaderFooter
Picture
OleObjects
Controls
AlternateContent
WebPublishItems
TableParts
WorksheetExtensionList
class XLBaseContentManager<T> : public XLBaseContentManager
class XLSheetViewContentManager : public ClosedXML::Excel::ContentManagers::XLBaseContentManager<XLSheetViewContents>
class XLWorksheetContentManager : public ClosedXML::Excel::ContentManagers::XLBaseContentManager<XLWorksheetContents>
namespace Drawings

Enums

enum XLMarkerPosition

Values:

TopLeft
BottomRight
enum XLPictureFormat

Values:

Unknown
Bmp
Gif
Png
Tiff
Icon
Pcx
Jpeg
Emf
Wmf
enum XLPicturePlacement

Values:

MoveAndSize
Move
FreeFloating
interface IXLPicture : public IDisposable

Subclassed by XLPicture

Public Functions

IXLPicture CopyTo (IXLWorksheet targetSheet)

Create a copy of the picture on a different worksheet.

Param targetSheet

The worksheet to which the picture will be copied.

Return

A created copy of the picture.

void Delete ()

Deletes this picture.

IXLPicture Duplicate ()

Create a copy of the picture on the same worksheet.

Return

A created copy of the picture.

Properties

XLPictureFormat Format { get; set; }

Type of image. The supported formats are defined by OpenXML’s ImagePartType. Default value is “jpeg”

Int32 Width { get; set; }

Current width of the picture in pixels.

Int32 Height { get; set; }

Current height of the picture in pixels.

Int32 OriginalHeight { get; set; }

Original height of the picture in pixels.

Int32 OriginalWidth { get; set; }

Original width of the picture in pixels.

interface IXLPictures : public System::Collections::IEnumerable<IXLPicture>

Subclassed by XLPictures

class XLMarker
class XLPicture : public IXLPicture

Public Functions

IXLPicture CopyTo (IXLWorksheet targetSheet)

Create a copy of the picture on a different worksheet.

Param targetSheet

The worksheet to which the picture will be copied.

Return

A created copy of the picture.

IXLPicture Duplicate ()

Create a copy of the picture on the same worksheet.

Return

A created copy of the picture.

class XLPictures : public IXLPictures, public System::Collections::IEnumerable<XLPicture>
namespace Exceptions
class ClosedXMLException : public Exception

Subclassed by EmptyTableException

class EmptyTableException : public ClosedXMLException
namespace InsertData
class ArrayReader : public IInsertDataReader
class DataRecordReader : public IInsertDataReader
class DataTableReader : public IInsertDataReader
interface IInsertDataReader

A universal interface for different data readers used in InsertData logic.

Subclassed by ArrayReader, DataRecordReader, DataTableReader, NullDataReader, ObjectReader, SimpleNullableTypeReader, SimpleTypeReader, UntypedObjectReader

Public Functions

IEnumerable<IEnumerable<object>> GetData ()

Get a collection of records, each as a collection of values, extracted from a source.

int GetPropertiesCount ()

Get the number of properties to use as a table with. Actual number of may vary in different records.

string GetPropertyName (int propertyIndex)

Get the title of the property with the specified index.

int GetRecordsCount ()

Get the total number of records.

class InsertDataReaderFactory
class NullDataReader : public IInsertDataReader
class ObjectReader : public IInsertDataReader
class SimpleNullableTypeReader : public IInsertDataReader
class SimpleTypeReader : public IInsertDataReader
class UntypedObjectReader : public IInsertDataReader
namespace IO
class SharedStringTableWriter
class TextSerializer
class WorksheetPartWriter
namespace Patterns
class Quadrant<T> : public Quadrant

A generic version of Quadrant

Public Functions

bool Add (IXLAddressable range)

Add a range to the quadrant or to one of the child quadrants (recursively).

Return

True, if range was successfully added, false if it has been added before.

IEnumerable<IXLAddressable> GetAll ()

Get all ranges from the quadrant and all child quadrants (recursively).

IEnumerable<IXLAddressable> GetIntersectedRanges (IXLRangeAddress rangeAddress)

Get all ranges from the quadrant and all child quadrants (recursively) that intersect the specified address.

IEnumerable<IXLAddressable> GetIntersectedRanges (IXLAddress address)

Get all ranges from the quadrant and all child quadrants (recursively) that cover the specified address.

bool Remove (IXLRangeAddress rangeAddress)

Remove the range from the quadrant or from child quadrants (recursively).

Return

True if the range was removed, false if it does not exist in the QuadTree.

IEnumerable<IXLAddressable> RemoveAll (Predicate<IXLAddressable> predicate)

Remove all the ranges matching specified criteria from the quadrant and its child quadrants (recursively). Don’t use it for searching intersections as it would be much less efficient than GetIntersectedRanges(IXLRangeAddress).

Properties

Quadrant > Children { get; set; }

Smaller quadrants which the current one is split to. Is NULL until ranges are added to child quadrants.

byte Level { get; set; }

The level of current quadrant. Top most has level 0, child quadrants has levels (Level + 1).

int MinimumColumn { get; set; }

Minimum column included in this quadrant.

int MinimumRow { get; set; }

Minimum row included in this quadrant.

int MaximumColumn { get; set; }

Maximum column included in this quadrant.

int MaximumRow { get; set; }

Maximum row included in this quadrant.

IXLAddressable >? Ranges { get; set; }

Collection of ranges belonging to this quadrant (does not include ranges from child quadrants).

short X { get; set; }

The number of current quadrant by horizontal axis.

short Y { get; set; }

The number of current quadrant by vertical axis.

namespace Ranges
namespace Index
interface IXLRangeIndex<T> : public IXLRangeIndex
class XLRangeIndex<T> : public XLRangeIndex, public ClosedXML::Excel::Ranges::Index::IXLRangeIndex<T>, public IXLRangeIndex

Generic version of XLRangeIndex.