Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

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

Signature
C#C#
Wiki Markup
{description}
{excerpt}Saves a specified [Workbook|Workbook] as a BIFF8 format \(Excel 97 or later\).xls file.{excerpt}
{signature:C#}
 public virtual void Save(Workbook workbook, System.IO.Stream stream)
Signature
{signature}{signature:vb.net
vb.net
}
Public Overridable Sub Save(ByVal workbook As Workbook, ByVal stream As System.IO.Stream)
Parameters

...

A Workbook object representing the workbook to save.

...

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
{signature}
{parameters}
{param:workbook}A {{Workbook}} object representing the workbook to save.{param}
{param: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.{param}
{exceptions}
{exception:System.Exception}If there is a problem creating, opening, or writing to the file specified, or reading from the workbook object.{exception}
{example}{code:csharp|title=C#}

          ExcelApplication oExcelApp = new ExcelApplication();
          Workbook wb = oExcelApp.Create();
          FileStream fstream = new FileStream(@"C:\temp\outfile.xls",
               FileMode.Create);
          oExcelApp.Save(wb,fstream);
        
{code}
{code:vb.net
|title=vb.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)
        {code}

{example}
Exception
System.ExceptionSystem.Exception

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

Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle