[]
        
(Showing Draft Content)

C1.Excel.C1XLBook.Load

Load Method

Load(string)

Loads an Excel worksheet from a file.

Declaration
public void Load(string fileName)
Parameters
Type Name Description
string fileName

Name of the file that contains the worksheet.

Remarks
<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.

Load(string, bool)

Loads an Excel worksheet from a file.

Declaration
public void Load(string fileName, bool fillSheets)
Parameters
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.

Load(string, FileFormat)

Loads an Excel worksheet from a file.

Declaration
public void Load(string fileName, FileFormat format)
Parameters
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.

Load(string, FileFormat, bool)

Loads an Excel worksheet from a file.

Declaration
public void Load(string fileName, FileFormat format, bool fillSheets)
Parameters
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.

Load(Stream)

Loads the worksheet from a stream.

Declaration
public void Load(Stream stream)
Parameters
Type Name Description
Stream stream

Stream that contains the worksheet.

Load(Stream, bool)

Loads the worksheet from a stream.

Declaration
public void Load(Stream stream, bool fillSheets)
Parameters
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.

Load(Stream, FileFormat)

Loads the worksheet from a stream.

Declaration
public void Load(Stream stream, FileFormat format)
Parameters
Type Name Description
Stream stream

Stream that contains the worksheet.

FileFormat format

C1.Excel.C1XLBook.FileFormat value that specifies the file format.

Remarks

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).

Load(Stream, FileFormat, bool)

Loads the worksheet from a stream.

Declaration
public void Load(Stream stream, FileFormat format, bool fillSheets)
Parameters
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.