[]
Loads an Excel worksheet from a file.
public void Load(string fileName)
Type | Name | Description |
---|---|---|
string | fileName | Name of the file that contains the worksheet. |
<p>Component One Excel infers the file format automatically based on the
file name extension. "XLSX" and "ZIP" files are loaded as OpenXml; all others are loaded as Biff8 files ("xls").
If the file doesn't exist, is locked, or is not a valid Excel file, an exception is thrown.
Loads an Excel worksheet from a file.
public void Load(string fileName, bool fillSheets)
Type | Name | Description |
---|---|---|
string | fileName | Name of the file that contains the worksheet. |
bool | fillSheets | True to load data into the sheets; False to read the sheet names only. |
Loads an Excel worksheet from a file.
public void Load(string fileName, FileFormat format)
Type | Name | Description |
---|---|---|
string | fileName | Name of the file that contains the worksheet. |
FileFormat | format | C1.Excel.C1XLBook.FileFormat value that specifies the file format. |
Loads an Excel worksheet from a file.
public void Load(string fileName, FileFormat format, bool fillSheets)
Type | Name | Description |
---|---|---|
string | fileName | Name of the file that contains the worksheet. |
FileFormat | format | C1.Excel.C1XLBook.FileFormat value that specifies the file format. |
bool | fillSheets | True to load data into the sheets; False to read the sheet names only. |
Loads the worksheet from a stream.
public void Load(Stream stream)
Type | Name | Description |
---|---|---|
Stream | stream | Stream that contains the worksheet. |
Loads the worksheet from a stream.
public void Load(Stream stream, bool fillSheets)
Type | Name | Description |
---|---|---|
Stream | stream | Stream that contains the worksheet. |
bool | fillSheets | True to load data into the sheets; False to read the sheet names only. |
Loads the worksheet from a stream.
public void Load(Stream stream, FileFormat format)
Type | Name | Description |
---|---|---|
Stream | stream | Stream that contains the worksheet. |
FileFormat | format | C1.Excel.C1XLBook.FileFormat value that specifies the file format. |
Loading the worksheets without their data is much faster than loading the entire workbook. This is useful in situations where you want to examine the contents of the file (for example, to ensure that you will not overwrite an existing sheet).
Loads the worksheet from a stream.
public void Load(Stream stream, FileFormat format, bool fillSheets)
Type | Name | Description |
---|---|---|
Stream | stream | Stream that contains the worksheet. |
FileFormat | format | C1.Excel.C1XLBook.FileFormat value that specifies the file format. |
bool | fillSheets | True to load data into the sheets; False to read the sheet names only. |