Opens an Excel workbook from a stream and returns a Workbook object.

 public virtual Workbook Open(System.IO.Stream stream, System.String decryptPassword)
Public Overridable Function Open(ByVal stream As System.IO.Stream, ByVal decryptPassword As String) As Workbook

A System.IO.Stream containing a BIFF8 format (Excel 97 or later) .xls file.

The password used to encrypt the spreadsheet. Standard "Office 97/2000 Compatible" encryption is used to encrypt the spreadsheet. This is the default encryption used by Excel 97 and later versions.

A Workbook object representing the file to open.

If the file cannot be found or opened, or if the file is not a BIFF8 format (Excel 97 or later) .xls file.

If decryptPassword is not the password that can decrypt the workbook.

ExcelWriter supports Excel's BIFF8 (Excel 97 or later) format only. Do not use this method to open BIFF7 (Excel 95) files.


          ExcelApplication xla = new ExcelApplication();
          FileStream fStrm = new FileStream(@"C:\Sales\2003\June.xls", FileMode.Open);
          Workbook wb = xla.Open(fStrm, "MyPassword");
        

          Dim xla As New ExcelApplication()
          Dim fStrm As FileStream = New FileStream("C:\Sales\2003\June.xls")
          Dim wb As Workbook = xla.Open(fStrm, "MyPassword")