# GrapeCity.Spreadsheet.IWorkbook.SaveAs

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_IWorkbook_SaveAs_" data-uid="GrapeCity.Spreadsheet.IWorkbook.SaveAs*">SaveAs Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_IWorkbook_SaveAs_" data-uid="GrapeCity.Spreadsheet.IWorkbook.SaveAs*"></a>
<h4 id="GrapeCity_Spreadsheet_IWorkbook_SaveAs_System_IO_Stream_GrapeCity_Spreadsheet_IO_FileFormat_System_String_GrapeCity_Spreadsheet_IO_OpenXml_ExportContext_" data-uid="GrapeCity.Spreadsheet.IWorkbook.SaveAs(System.IO.Stream,GrapeCity.Spreadsheet.IO.FileFormat,System.String,GrapeCity.Spreadsheet.IO.OpenXml.ExportContext)">SaveAs(Stream, FileFormat, string, ExportContext)</h4>
<div class="markdown level1 summary"><p>Saves this <a class="xref" href="GrapeCity.Spreadsheet.IWorkbook.html">IWorkbook</a> to the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">bool SaveAs(Stream stream, FileFormat fileFormat = FileFormat.OpenXMLWorkbook, string password = null, ExportContext context = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function SaveAs(stream As Stream, Optional fileFormat As FileFormat = FileFormat.OpenXMLWorkbook, Optional password As String = Nothing, Optional context As ExportContext = Nothing) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></td>
      <td><span class="parametername">stream</span></td>
      <td><p>A <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a> object indicates the stream to save to.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.IO.FileFormat.html">FileFormat</a></td>
      <td><span class="parametername">fileFormat</span></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.IO.FileFormat.html">FileFormat</a> value indicates the file format when saving the workbook.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">password</span></td>
      <td><p>A case-sensitive string (no more than 15 characters) that indicates the protection password to be given to the file.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.IO.OpenXml.ExportContext.html">ExportContext</a></td>
      <td><span class="parametername">context</span></td>
      <td><p>An <a class="xref" href="GrapeCity.Spreadsheet.IO.OpenXml.ExportContext.html">ExportContext</a> object indicates the export context.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p><code>true</code> if this workbook is saved successful, <code>false</code> otherwise.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Spreadsheet_IWorkbook_SaveAs_" data-uid="GrapeCity.Spreadsheet.IWorkbook.SaveAs*"></a>
<h4 id="GrapeCity_Spreadsheet_IWorkbook_SaveAs_System_String_GrapeCity_Spreadsheet_IO_FileFormat_System_String_GrapeCity_Spreadsheet_IO_OpenXml_ExportContext_" data-uid="GrapeCity.Spreadsheet.IWorkbook.SaveAs(System.String,GrapeCity.Spreadsheet.IO.FileFormat,System.String,GrapeCity.Spreadsheet.IO.OpenXml.ExportContext)">SaveAs(string, FileFormat, string, ExportContext)</h4>
<div class="markdown level1 summary"><p>Saves this <a class="xref" href="GrapeCity.Spreadsheet.IWorkbook.html">IWorkbook</a> to the specified file location.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">bool SaveAs(string filename, FileFormat fileFormat = FileFormat.OpenXMLWorkbook, string password = null, ExportContext context = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function SaveAs(filename As String, Optional fileFormat As FileFormat = FileFormat.OpenXMLWorkbook, Optional password As String = Nothing, Optional context As ExportContext = Nothing) As Boolean</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">filename</span></td>
      <td><p>A string value indicates the file name to save to.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.IO.FileFormat.html">FileFormat</a></td>
      <td><span class="parametername">fileFormat</span></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.IO.FileFormat.html">FileFormat</a> value indicates the file format when saving the workbook.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">password</span></td>
      <td><p>A case-sensitive string (no more than 15 characters) that indicates the protection password to be given to the file.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.IO.OpenXml.ExportContext.html">ExportContext</a></td>
      <td><span class="parametername">context</span></td>
      <td><p>An <a class="xref" href="GrapeCity.Spreadsheet.IO.OpenXml.ExportContext.html">ExportContext</a> object indicates the export context.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><p><code>true</code> if this workbook is saved successful, <code>false</code> otherwise.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
