Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

Saves a specified Workbook as a BIFF8 format (Excel 97 or later).xls file.

Signature
C#
C#
 public virtual void Save(Workbook workbook, System.IO.Stream stream)
Signature
vb.net
vb.net
Public Overridable Sub Save(ByVal workbook As Workbook, ByVal stream As System.IO.Stream)
Parameters
Param
workbook
workbook

A Workbook object representing the workbook to save.

Param
stream
stream

The output stream to write to. This stream must be open and writable. ExcelWriter will not close this stream; the calling program is responsible for closing the stream and releasing the resource.

Exceptions
Exception
System.Exception
System.Exception

If there is a problem creating, opening, or writing to the file specified, or reading from the workbook object.

Example
Code Block
csharp
csharp
titleC#

          ExcelApplication oExcelApp = new ExcelApplication();
          Workbook wb = oExcelApp.Create();
          FileStream fstream = new FileStream(@"C:\temp\outfile.xls",
               FileMode.Create);
          oExcelApp.Save(wb,fstream);
        
Code Block
vb.net
vb.net
titlevb.net

          Dim oExcelApp As New ExcelApplication()
          Dim wb As Workbook = oExcelApp.Create()
          Dim fstream As New FileStream("C:\temp\outfile.xls", _
               FileMode.Create)
          oExcelApp.Save(wb, fstream)