Opens an Excel workbook from a stream and returns a Workbook object.
ExcelWriter supports Excel's BIFF8 (Excel 97 or later) format only. Do not use this method to open BIFF7 (Excel 95) files.
Parameters:
stream
A System.IO.Stream containing a BIFF8 format (Excel 97 or later) .xls file.
Returns:
Workbook A Workbook object representing the file opened.
Exceptions:
System.Exception
If the file cannot be found or opened, or if the file is not a BIFF8 format (Excel 97 or later) .xls file.
Examples:
[csharp]
ExcelApplication xla = new ExcelApplication();
FileStream fStrm = new FileStream(@"C:\Sales\2003\June.xls", FileMode.Open);
Workbook wb = xla.Open(fStrm);
[vbnet]
Dim xla As New ExcelApplication()
Dim fStrm As FileStream = New FileStream("C:\Sales\2003\June.xls", FileMode.Open)
Dim wb As Workbook = xla.Open(fStrm)