Interface IXLWorkbook
public interface IXLWorkbook : IXLProtectable<IXLWorkbookProtection, XLWorkbookProtectionElements>, IXLProtectable, IDisposable
- Inherited Members
- Extension Methods
Properties
Author
string Author { get; set; }
Property Value
CalculateMode
Gets or sets the workbook's calculation mode.
XLCalculateMode CalculateMode { get; set; }
Property Value
CalculationOnSave
bool CalculationOnSave { get; set; }
Property Value
Chartsheets
Gets an object to manipulate the chartsheets.
IXLChartsheets Chartsheets { get; }
Property Value
ColumnWidth
Gets or sets the default column width for the workbook.
All new worksheets will use this column width.
double ColumnWidth { get; set; }
Property Value
CustomProperties
IXLCustomProperties CustomProperties { get; }
Property Value
DefaultRightToLeft
bool DefaultRightToLeft { get; }
Property Value
DefaultShowFormulas
bool DefaultShowFormulas { get; }
Property Value
DefaultShowGridLines
bool DefaultShowGridLines { get; }
Property Value
DefaultShowOutlineSymbols
bool DefaultShowOutlineSymbols { get; }
Property Value
DefaultShowRowColHeaders
bool DefaultShowRowColHeaders { get; }
Property Value
DefaultShowRuler
bool DefaultShowRuler { get; }
Property Value
DefaultShowWhiteSpace
bool DefaultShowWhiteSpace { get; }
Property Value
DefaultShowZeros
bool DefaultShowZeros { get; }
Property Value
FileSharing
IXLFileSharing FileSharing { get; }
Property Value
ForceFullCalculation
bool ForceFullCalculation { get; set; }
Property Value
FullCalculationOnLoad
bool FullCalculationOnLoad { get; set; }
Property Value
FullPrecision
bool FullPrecision { get; set; }
Property Value
LockStructure
bool LockStructure { get; set; }
Property Value
LockWindows
bool LockWindows { get; set; }
Property Value
NamedRanges
Gets an object to manipulate this workbook's named ranges.
IXLNamedRanges NamedRanges { get; }
Property Value
Outline
Gets or sets the default outline options for the workbook.
All new worksheets will use these outline options.
IXLOutline Outline { get; set; }
Property Value
PageOptions
Gets or sets the default page options for the workbook.
All new worksheets will use these page options.
IXLPageSetup PageOptions { get; set; }
Property Value
PivotCaches
Gets all pivot caches in a workbook. A one cache can be used by multiple tables. Unused caches are not saved.
IXLPivotCaches PivotCaches { get; }
Property Value
PredefinedStyles
IXLPredefinedStyles PredefinedStyles { get; }
Property Value
Properties
Gets or sets the workbook's properties.
XLWorkbookProperties Properties { get; set; }
Property Value
ReferenceStyle
Gets or sets the workbook's reference style.
XLReferenceStyle ReferenceStyle { get; set; }
Property Value
RightToLeft
bool RightToLeft { get; set; }
Property Value
RowHeight
Gets or sets the default row height for the workbook.
All new worksheets will use this row height.
double RowHeight { get; set; }
Property Value
Sheets
Gets an object to manipulate the sheets.
IXLSheets Sheets { get; }
Property Value
ShowFormulas
bool ShowFormulas { get; set; }
Property Value
ShowGridLines
bool ShowGridLines { get; set; }
Property Value
ShowOutlineSymbols
bool ShowOutlineSymbols { get; set; }
Property Value
ShowRowColHeaders
bool ShowRowColHeaders { get; set; }
Property Value
ShowRuler
bool ShowRuler { get; set; }
Property Value
ShowWhiteSpace
bool ShowWhiteSpace { get; set; }
Property Value
ShowZeros
bool ShowZeros { get; set; }
Property Value
Style
Gets or sets the default style for the workbook.
All new worksheets will use this style.
IXLStyle Style { get; set; }
Property Value
Theme
Gets an object to manipulate this workbook's theme.
IXLTheme Theme { get; }
Property Value
Use1904DateSystem
bool Use1904DateSystem { get; set; }
Property Value
Worksheets
Gets an object to manipulate the worksheets.
IXLWorksheets Worksheets { get; }
Property Value
Methods
AddChartsheet()
IXLChartsheet AddChartsheet()
Returns
AddChartsheet(int)
IXLChartsheet AddChartsheet(int position)
Parameters
positionint
Returns
AddChartsheet(string)
IXLChartsheet AddChartsheet(string sheetName)
Parameters
sheetNamestring
Returns
AddChartsheet(string, int)
IXLChartsheet AddChartsheet(string sheetName, int position)
Parameters
Returns
AddWorksheet()
IXLWorksheet AddWorksheet()
Returns
AddWorksheet(IXLWorksheet)
void AddWorksheet(IXLWorksheet worksheet)
Parameters
worksheetIXLWorksheet
AddWorksheet(DataSet)
void AddWorksheet(DataSet dataSet)
Parameters
dataSetDataSet
AddWorksheet(DataTable)
Add a worksheet with a table at Cell(row:1, column:1). The dataTable's name is used for the worksheet name. The name of a table will be generated as Table{number suffix}.
IXLWorksheet AddWorksheet(DataTable dataTable)
Parameters
dataTableDataTableDatatable to insert
Returns
- IXLWorksheet
Inserted Worksheet
AddWorksheet(DataTable, string)
Add a worksheet with a table at Cell(row:1, column:1). The sheetName provided is used for the worksheet name. The name of a table will be generated as Table{number suffix}.
IXLWorksheet AddWorksheet(DataTable dataTable, string sheetName)
Parameters
dataTableDataTabledataTable to insert as Excel Table
sheetNamestringWorksheet and Excel Table name
Returns
- IXLWorksheet
Inserted Worksheet
AddWorksheet(DataTable, string, string)
Add a worksheet with a table at Cell(row:1, column:1).
IXLWorksheet AddWorksheet(DataTable dataTable, string sheetName, string tableName)
Parameters
dataTableDataTabledataTable to insert as Excel Table
sheetNamestringWorksheet name
tableNamestringExcel Table name
Returns
- IXLWorksheet
Inserted Worksheet
AddWorksheet(int)
IXLWorksheet AddWorksheet(int position)
Parameters
positionint
Returns
AddWorksheet(string)
IXLWorksheet AddWorksheet(string sheetName)
Parameters
sheetNamestring
Returns
AddWorksheet(string, int)
IXLWorksheet AddWorksheet(string sheetName, int position)
Parameters
Returns
Cell(string)
IXLCell Cell(string namedCell)
Parameters
namedCellstring
Returns
Cells(string)
IXLCells Cells(string namedCells)
Parameters
namedCellsstring
Returns
Chartsheet(int)
IXLChartsheet Chartsheet(int position)
Parameters
positionint
Returns
Chartsheet(string)
IXLChartsheet Chartsheet(string name)
Parameters
namestring
Returns
CustomProperty(string)
IXLCustomProperty CustomProperty(string name)
Parameters
namestring
Returns
Evaluate(string)
Evaluate a formula expression.
XLCellValue Evaluate(string expression)
Parameters
expressionstringFormula expression to evaluate.
Returns
Exceptions
- MissingContextException
If the expression contains a function that requires a context (e.g. current cell or worksheet).
FindCells(Func<IXLCell, bool>)
IXLCells FindCells(Func<IXLCell, bool> predicate)
Parameters
Returns
FindColumns(Func<IXLColumn, bool>)
IXLColumns FindColumns(Func<IXLColumn, bool> predicate)
Parameters
Returns
FindRows(Func<IXLRow, bool>)
IXLRows FindRows(Func<IXLRow, bool> predicate)
Parameters
Returns
NamedRange(string)
IXLNamedRange NamedRange(string rangeName)
Parameters
rangeNamestring
Returns
Range(string)
IXLRange Range(string range)
Parameters
rangestring
Returns
RangeFromFullAddress(string, out IXLWorksheet)
IXLRange RangeFromFullAddress(string rangeAddress, out IXLWorksheet ws)
Parameters
rangeAddressstringwsIXLWorksheet
Returns
Ranges(string)
IXLRanges Ranges(string ranges)
Parameters
rangesstring
Returns
RecalculateAllFormulas()
Force recalculation of all cell formulas.
void RecalculateAllFormulas()
Save()
Saves the current workbook.
void Save()
Save(SaveOptions)
void Save(SaveOptions options)
Parameters
optionsSaveOptions
Save(bool, bool)
Saves the current workbook and optionally performs validation
void Save(bool validate, bool evaluateFormulae = false)
Parameters
SaveAs(Stream)
Saves the current workbook to a stream.
void SaveAs(Stream stream)
Parameters
streamStream
SaveAs(Stream, SaveOptions)
void SaveAs(Stream stream, SaveOptions options)
Parameters
streamStreamoptionsSaveOptions
SaveAs(Stream, bool, bool)
Saves the current workbook to a stream and optionally validates it.
void SaveAs(Stream stream, bool validate, bool evaluateFormulae = false)
Parameters
SaveAs(string)
Saves the current workbook to a file.
void SaveAs(string file)
Parameters
filestring
SaveAs(string, SaveOptions)
void SaveAs(string file, SaveOptions options)
Parameters
filestringoptionsSaveOptions
SaveAs(string, bool, bool)
Saves the current workbook to a file and optionally validates it.
void SaveAs(string file, bool validate, bool evaluateFormulae = false)
Parameters
Search(string, CompareOptions, bool)
Searches the cells' contents for a given piece of text
IEnumerable<IXLCell> Search(string searchText, CompareOptions compareOptions = CompareOptions.Ordinal, bool searchFormulae = false)
Parameters
searchTextstringThe search text.
compareOptionsCompareOptionsThe compare options.
searchFormulaeboolif set to
truesearch formulae instead of cell values.
Returns
SetLockStructure(bool)
XLWorkbook SetLockStructure(bool value)
Parameters
valuebool
Returns
SetLockWindows(bool)
XLWorkbook SetLockWindows(bool value)
Parameters
valuebool
Returns
SetUse1904DateSystem()
XLWorkbook SetUse1904DateSystem()
Returns
SetUse1904DateSystem(bool)
XLWorkbook SetUse1904DateSystem(bool value)
Parameters
valuebool
Returns
Sheet(int)
IXLSheet Sheet(int position)
Parameters
positionint
Returns
Sheet(string)
IXLSheet Sheet(string name)
Parameters
namestring
Returns
Table(string, StringComparison)
Gets the Excel table of the given name
IXLTable Table(string tableName, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase)
Parameters
tableNamestringName of the table to return.
comparisonTypeStringComparisonOne of the enumeration values that specifies how the strings will be compared.
Returns
- IXLTable
The table with given name
Exceptions
- ArgumentOutOfRangeException
If no tables with this name could be found in the workbook.
TryGetChartsheet(string, out IXLChartsheet)
bool TryGetChartsheet(string name, out IXLChartsheet worksheet)
Parameters
namestringworksheetIXLChartsheet
Returns
TryGetSheet(string, out IXLSheet)
bool TryGetSheet(string name, out IXLSheet worksheet)
Parameters
Returns
TryGetWorksheet(string, out IXLWorksheet)
bool TryGetWorksheet(string name, out IXLWorksheet worksheet)
Parameters
namestringworksheetIXLWorksheet
Returns
Worksheet(int)
IXLWorksheet Worksheet(int position)
Parameters
positionint
Returns
Worksheet(string)
IXLWorksheet Worksheet(string name)
Parameters
namestring