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
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:vb.net}
Public Overridable Sub Save(ByVal workbook As Workbook, ByVal stream As System.IO.Stream)
{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}