NativeExcel2 for .Net Developer's Reference

Factory.OpenWorkbookMethod(Stream, String)

Opens an existing workbook from a stream and returns IWorkbook interface.

[Visual Basic]
SharedOverloadsPublicFunctionOpenWorkbook(_
ByValinputStreamAsStream,_
ByValPasswordAsString_
)AsIWorkbook
[C#]
publicstaticIWorkbookOpenWorkbook(
StreaminputStream,
stringPassword
);
[C++]
public:staticIWorkbook*OpenWorkbook(
Stream*inputStream,
String*Password
);
[JScript]
publicstaticfunctionOpenWorkbook(
StreaminputStream,
StringPassword
):IWorkbook;

Parameters

inputStream
The input stream containing the workbook to be opened.
Password
A string that contains the password required to open a protected workbook.

Return Value

Returns IWorkbook interface.

Example

[C#]
 IWorkbook book; 
 using (FileStream inputStream = File.OpenRead("book.xls")) {
     book = NativeExcel.Factory.OpenWorkbook(inputStream, "pass123");
 }

See Also

Factory Class | NativeExcel Namespace | Factory.OpenWorkbook Overload List | IWorkbook Interface