# GrapeCity.Spreadsheet.IWorkbooks.Open

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_IWorkbooks_Open_" data-uid="GrapeCity.Spreadsheet.IWorkbooks.Open*">Open Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_IWorkbooks_Open_" data-uid="GrapeCity.Spreadsheet.IWorkbooks.Open*"></a>
<h4 id="GrapeCity_Spreadsheet_IWorkbooks_Open_System_String_GrapeCity_Spreadsheet_IO_OpenXml_ImportContext_" data-uid="GrapeCity.Spreadsheet.IWorkbooks.Open(System.String,GrapeCity.Spreadsheet.IO.OpenXml.ImportContext)">Open(string, ImportContext)</h4>
<div class="markdown level1 summary"><p>Open an existing workbook in a newly created instance of <span class="xref">GrapeCity.Spreadsheet.Workbook</span>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">IWorkbook Open(string filename, ImportContext context = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Open(filename As String, Optional context As ImportContext = Nothing) As IWorkbook</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>The name of the file to open.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.IO.OpenXml.ImportContext.html">ImportContext</a></td>
      <td><span class="parametername">context</span></td>
      <td><p>An <a class="xref" href="GrapeCity.Spreadsheet.IO.OpenXml.ImportContext.html">ImportContext</a> object indicates the import 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="GrapeCity.Spreadsheet.IWorkbook.html">IWorkbook</a></td>
      <td><p>A <span class="xref">GrapeCity.Spreadsheet.Workbook</span> object represents the opened workbook.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Spreadsheet_IWorkbooks_Open_" data-uid="GrapeCity.Spreadsheet.IWorkbooks.Open*"></a>
<h4 id="GrapeCity_Spreadsheet_IWorkbooks_Open_System_IO_Stream_GrapeCity_Spreadsheet_IO_OpenXml_ImportContext_System_Boolean_" data-uid="GrapeCity.Spreadsheet.IWorkbooks.Open(System.IO.Stream,GrapeCity.Spreadsheet.IO.OpenXml.ImportContext,System.Boolean)">Open(Stream, ImportContext, bool)</h4>
<div class="markdown level1 summary"><p>Open an existing workbook in a newly created instance of <span class="xref">GrapeCity.Spreadsheet.Workbook</span>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">IWorkbook Open(Stream stream, ImportContext context = null, bool closing = true)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Open(stream As Stream, Optional context As ImportContext = Nothing, Optional closing As Boolean = True) As IWorkbook</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>The stream containing the workbook to open.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Spreadsheet.IO.OpenXml.ImportContext.html">ImportContext</a></td>
      <td><span class="parametername">context</span></td>
      <td><p>An <a class="xref" href="GrapeCity.Spreadsheet.IO.OpenXml.ImportContext.html">ImportContext</a> object indicates the import context.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">closing</span></td>
      <td><p><code>true</code> if the <code class="paramref">stream</code> will be closed after finish opening. <code>false</code> to leave it as opened.</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="GrapeCity.Spreadsheet.IWorkbook.html">IWorkbook</a></td>
      <td><p>A <span class="xref">GrapeCity.Spreadsheet.Workbook</span> object represents the opened workbook.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
