Click or drag to resize

WorkBook Class

Class that stands for a whole Excel file. This is the first object most users will construct whether they are reading or writing a workbook. It is also the top level (home-base) object for creating new sheets and most other Excel programing operations.
Inheritance Hierarchy
SystemObject
  IronXLWorkBook

Namespace:  IronXL
Assembly:  IronXL (in IronXL.dll) Version: 2019.3.2
Syntax
public class WorkBook

The WorkBook type exposes the following members.

Constructors
  NameDescription
Public methodWorkBook(String)
Loads a new instance of the WorkBook by loading a CSV, TSV, XLS or XLSX file.
Public methodWorkBook(ExcelFileFormat)
Initializes a new instance of the WorkBook class as a new empty spreadsheet in XLS or XLSX format. ///
Top
Properties
  NameDescription
Public propertyDefaultWorkSheet
First worksheet within this range
Public propertyMetadata
Gets the metadata of the document.
Public propertyWorkSheets
List of worksheets within current workbook
Top
Methods
  NameDescription
Public methodStatic memberCreate
Create new XLSX Excel WorkBook.
Public methodStatic memberCreate(CreatingOptions)
Create new workbook with the specified options.
Public methodStatic memberCreate(ExcelFileFormat)
Create new workbook with the specified format.
Public methodCreateWorkSheet
Create new worksheet with the specified name
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetWorkSheet
Returns a WorkSheet within this WorkBook; identified by its name.

Returns null if the named worksheet would not be found.

Public methodStatic memberImport
Imports and creates a new workbook from specified CSV, TSV, JSON or XML file.
Public methodStatic memberLoad(String)
Load workbook from specified file.

Shortcut synonym for LoadExcel(String)

Public methodStatic memberLoad(String, LoadingOptions)
Load workbook from a specified file.

Supported formats are: XLS, XLSX, CSV, TSV, JSON, XML.

Public methodStatic memberLoadCSV
Imports and creates a new workbook from specified CSV or TSV file.
Public methodStatic memberLoadExcel
Load workbook from specified file.
Public methodSaveAs(String)
Save workbook with the specified filename.

Supported formats are: XLS, XLSX, CSV, TSV, JSON, XML

Public methodSaveAs(String, SavingOptions)
Save workbook with the specified filename.

Supported formats are: XLS, XLSX, CSV, TSV, JSON, XML

Public methodSaveAsCsv
Exports the Excel file as CSV.
Public methodSaveAsJson
Exports the Excel file as JSON.
Public methodSaveAsXml
Exports the Excel file as XML.
Public methodToDataSet
Export workbook to a native System.Data DataSet.

Each worksheet represents a DataTable within the DataSet.

Useful when moving data between Excel and SQL.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also