Click or drag to resize
ExcelFileLoad Method (Stream, LoadOptions)
Loads a spreadsheet from the specified stream.

Namespace: GemBox.Spreadsheet
Assembly: GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 39.3.30.1198
Syntax
public static ExcelFile Load(
	Stream stream,
	LoadOptions options
)

Parameters

stream
Type: System.IOStream
The stream from which to load a spreadsheet.
options
Type: GemBox.SpreadsheetLoadOptions
The loading options which can be used to define settings for load operation.

Return Value

Type: ExcelFile
A loaded spreadsheet.
Examples

Following code demonstrates different ways of loading ExcelFile.

// Loads a spreadsheet from a file with the specified path
ExcelFile ef = ExcelFile.Load(fileName);

using (FileStream stream = new FileStream(fileName, FileMode.Open))
{
    // Loads a spreadsheet from the specified stream
    ef = ExcelFile.Load(stream, LoadOptions.XlsxDefault);
}

// Loads a spreadsheet using specified options
ef = ExcelFile.Load(fileName, new XlsxLoadOptions() { PreserveUnsupportedFeatures = false });
See Also