Forums     Knowledge Base     OfficeWriter Online     
 
 
This documentation is for
OfficeWriter v3.7.1
.NET Platform

View Docs for Another
Version or Platform

Programmer's Reference > ExcelApplication API > ExcelApplication > Open

Open Method



Signature:

public Workbook Open ( System.IO.Stream stream , String decryptPassword )

Description:

Parameters:

stream     A System.IO.Stream containing a BIFF8 format (Excel 97 or later) .xls file.
decryptPassword     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.

Returns:

Workbook A Workbook object representing the file to open.

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, "MyPassword");
[vbnet]
Dim xla As New ExcelApplication()
Dim fStrm As FileStream = New FileStream("C:\Sales\2003\June.xls")
Dim wb As Workbook = xla.Open(fStrm, "MyPassword")



Copyright 2006 © SoftArtisans, Inc. All Rights Reserved.