Click or drag to resize

ExcelWorkbook Class

The Excel Workbook
Inheritance Hierarchy
SystemObject
  ExpertXls.ExcelLibExcelWorkbook

Namespace:  ExpertXls.ExcelLib
Assembly:  expertxls (in expertxls.dll) Version: 7.0.0
Syntax
public class ExcelWorkbook

The ExcelWorkbook type exposes the following members.

Constructors
  NameDescription
Public methodExcelWorkbook
Creates a workbook with a single worksheet. The default workbook format is Excel 2003. To create a workbook for a different Excel format, like Excel 2007-2019 or above, you can use the constructor with the Format parameter.
Public methodExcelWorkbook(Stream)
Opens a workbook from the specified Excel stream
Public methodExcelWorkbook(String)
Opens a workbook from the specified Excel file
Public methodExcelWorkbook(ExcelWorkbookFormat)
Creates a workbook with a single worksheet. The format of the workbook is specified by the workbookFormat parameter. The currently supported formats are Excel 97-2003 format and Excel 2007-2019 or above format.
Public methodExcelWorkbook(Stream, String)
Opens a workbook from the specified Excel stream with the specified password
Public methodExcelWorkbook(String, String)
Opens a workbook from the specified Excel file with the specified password
Public methodExcelWorkbook(ExcelWorkbookFormat, ExcelWorkbookDefaultSettings)
Creates a workbook with a single worksheet. The format of the workbook is specified by the workbookFormat parameter. The currently supported formats are Excel 97-2003 format and Excel 2007-2019 or above format.
Public methodExcelWorkbook(Stream, String, ExcelWorkbookDefaultSettings)
Opens a workbook from the specified Excel stream with the specified password
Public methodExcelWorkbook(String, String, ExcelWorkbookDefaultSettings)
Opens a workbook from the specified Excel file with the specified password
Top
Properties
  NameDescription
Public propertyActiveSheetIndex
Gets or sets the active sheet index. The index is zero based. The property can be set with a non-negative value. Returns a negative value when no sheet is active in the workbook.
Public propertyChartWorksheets
Gets the collection of chart worksheets of this workbook.
Public propertyDefaultColumnWidthChars
Gets default column width in characters for the newly created worksheets.
Public propertyDefaultFontName
Gets or sets default font name for the newly created worksheets.
Public propertyDefaultFontSizePoints
Gets or sets default font size in points for the newly created worksheets.
Public propertyDefaultRowHeightPoints
Gets the default row height in points for the newly created worksheets.
Public propertyDocumentProperties
Gets the object encpsulating the document properties like author, title, subject, etc.
Public propertyDocumentSecurity
Gets an object used to manage the document security like workbook structure and windows protection, workbook open/write password protection. Works only for Excel 2003 .xls format.
Public propertyFormat
Gets or sets the Excel workbook format (Excel 97-2003 .xls or Excel 2007-2019 or above .xlsx). This property gives the output format when the workbook is saved and controls the features allowed when the workbook is updated by the library. When creating an empty workbook the format is Excel 97-2003. When the workbook is created from an existing excel file or stream, the format is the format of the opened excel document.
Public propertyFormulaNumberFormat
Gets or sets the number format in formula used when parsing formulas. Set this property before assigning a formula expression to a cell. The default value is the number format for the current culture.
Public propertyFormulaParamsSeparator
Gets or sets the separator between formula parameters used when parsing formulas. Set this property before assigning a formula expression to a cell. The default value is ','.
Public propertyFormulaRowsSeparator
Gets or sets the rows separator used when parsing arrays in formulas. Set this property before assigning a formula expression to a cell. The default value is ';'
Public propertyLicenseKey
Gets or sets the license key for the library. When this property is set to null value the library works in demo mode.
Public propertyNamedRanges
Gets the named ranges collection of this workbook (Workbook scope named ranges).
Public propertyPalette
Gets the colors palette of the workbook.
Public propertyReadOnly
Gets a value that indicates whether the workbook has been opened as read-only
Public propertyStyles
Gets the cell styles collection of this workbook.
Public propertyUnitsConverter
Gets an object used to convert values between various Excel measurement units (points, pixels, width characters)
Public propertyWorksheets
Gets the worksheets collection of this workbook.
Top
Methods
  NameDescription
Public methodClose
Closes the workbook and releases all the resources.
Public methodDisableFormulaCalculations
Disable formula calculations for all the sheets existing in the workbook at the current time.
Public methodEnableFormulaCalculations
Enable formula calculations for all the sheets existing in the workbook at the current time.
Public methodStatic memberLoadFromCsv(Stream, String, ExcelWorkbookFormat)
Loads a CSV stream into a worksheet. The default encoding of the text in CSV is assumed to be UTF-8. The values from CSV will be imported in the top left corner of the worksheet.
Public methodStatic memberLoadFromCsv(String, String, ExcelWorkbookFormat)
Loads a CSV file into a worksheet. The default encoding of the text in CSV is assumed to be UTF-8. The values from CSV will be imported in the top left corner of the worksheet.
Public methodStatic memberLoadFromCsv(Stream, Encoding, String, Int32, Int32, ExcelWorkbookFormat, ExcelWorkbookDefaultSettings)
Loads a CSV stream into a worksheet.
Public methodStatic memberLoadFromCsv(String, Encoding, String, Int32, Int32, ExcelWorkbookFormat, ExcelWorkbookDefaultSettings)
Loads a CSV file into a worksheet.
Public methodSave
Saves the Excel workbook as byte array that can be further saved into a file or send over HTTP. The output format (Excel 97-2003 .xls or Excel 2007-2019 or above .xlsx) is the current format of the workbook.
Public methodSave(Stream)
A Saves the workbook in the specified stream. The output format (Excel 97-2003 .xls or Excel 2007-2019 or above .xlsx) is the current format of the workbook.
Public methodSave(String)
Saves the workbook as the specified file. The output format (Excel 97-2003 .xls or Excel 2007-2019 or above .xlsx) is the current format of the workbook.
Public methodSave(HttpResponse, String)
Saves the workbook to the specified HttpResponse. The output format (Excel 97-2003 .xls or Excel 2007-2019 or above .xlsx) is the current format of the workbook.
Public methodSave(HttpResponse, String, Boolean)
Saves the workbook to the specified HttpResponse. The output format (Excel 97-2003 .xls or Excel 2007-2019 or above .xlsx) is the current format of the workbook.
Public methodSaveToCsv(Int32, Stream, String)
Saves the worksheet at the specified index to a stream in CSV format. The default UTF-8 text encoding is used when saving the output stream.
Public methodSaveToCsv(Int32, String, String)
Saves the worksheet at the specified index to a file in CSV format. The default UTF-8 text encoding is used when saving the output file.
Public methodSaveToCsv(Int32, Stream, String, Encoding)
Saves the worksheet at the specified index to a stream in CSV format using the specified text encoding for the output.
Public methodSaveToCsv(Int32, String, String, Encoding)
Saves the worksheet at the specified index to a file in CSV format using the specified text encoding for the output file.
Public methodUpdateFormulaResult
Calculate formula results for all the worksheets in the workbook
Top
See Also