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 )

Description:

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)



Copyright 2006 © SoftArtisans, Inc. All Rights Reserved.