# GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.OpenExcel

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Wpf_SpreadSheet_GcSpreadSheet_OpenExcel_" data-uid="GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.OpenExcel*">OpenExcel Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Wpf_SpreadSheet_GcSpreadSheet_OpenExcel_" data-uid="GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.OpenExcel*"></a>
<h4 id="GrapeCity_Wpf_SpreadSheet_GcSpreadSheet_OpenExcel_System_String_GrapeCity_Spreadsheet_IO_OpenXml_ImportContext_" data-uid="GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.OpenExcel(System.String,GrapeCity.Spreadsheet.IO.OpenXml.ImportContext)">OpenExcel(string, ImportContext)</h4>
<div class="markdown level1 summary"><p>Opens an Excel file and loads it into Spread.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool OpenExcel(string filename, ImportContext context)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function OpenExcel(filename As String, context As ImportContext) 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>Path and name of file to open.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="../GrapeCity.Spreadsheet/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/GrapeCity.Spreadsheet.IO.OpenXml.ImportContext.html">ImportContext</a> object indicating the settings to open.</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 the file is opened successful; otherwise, <code>false</code>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Wpf_SpreadSheet_GcSpreadSheet_OpenExcel_" data-uid="GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.OpenExcel*"></a>
<h4 id="GrapeCity_Wpf_SpreadSheet_GcSpreadSheet_OpenExcel_System_String_GrapeCity_Spreadsheet_IO_OpenXml_ImportOptions_" data-uid="GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.OpenExcel(System.String,GrapeCity.Spreadsheet.IO.OpenXml.ImportOptions)">OpenExcel(string, ImportOptions)</h4>
<div class="markdown level1 summary"><p>Opens an Excel file and loads it into Spread.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool OpenExcel(string filename, ImportOptions options = ImportOptions.Default)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function OpenExcel(filename As String, Optional options As ImportOptions = ImportOptions.Default) 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>Path and name of file to open.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="../GrapeCity.Spreadsheet/GrapeCity.Spreadsheet.IO.OpenXml.ImportOptions.html">ImportOptions</a></td>
      <td><span class="parametername">options</span></td>
      <td><p>An <a class="xref" href="../GrapeCity.Spreadsheet/GrapeCity.Spreadsheet.IO.OpenXml.ImportOptions.html">ImportOptions</a> value indicating the settings to open.</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 the file is opened successful; otherwise, <code>false</code>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Wpf_SpreadSheet_GcSpreadSheet_OpenExcel_" data-uid="GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.OpenExcel*"></a>
<h4 id="GrapeCity_Wpf_SpreadSheet_GcSpreadSheet_OpenExcel_System_IO_Stream_GrapeCity_Spreadsheet_IO_OpenXml_ImportOptions_" data-uid="GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.OpenExcel(System.IO.Stream,GrapeCity.Spreadsheet.IO.OpenXml.ImportOptions)">OpenExcel(Stream, ImportOptions)</h4>
<div class="markdown level1 summary"><p>Opens an Excel file and loads it into Spread.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool OpenExcel(Stream stream, ImportOptions options = ImportOptions.Default)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function OpenExcel(stream As Stream, Optional options As ImportOptions = ImportOptions.Default) 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>Stream that contains an Excel file.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="../GrapeCity.Spreadsheet/GrapeCity.Spreadsheet.IO.OpenXml.ImportOptions.html">ImportOptions</a></td>
      <td><span class="parametername">options</span></td>
      <td><p>An <a class="xref" href="../GrapeCity.Spreadsheet/GrapeCity.Spreadsheet.IO.OpenXml.ImportOptions.html">ImportOptions</a> value indicating the settings to open.</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 the file is opened successful; otherwise, <code>false</code>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Wpf_SpreadSheet_GcSpreadSheet_OpenExcel_" data-uid="GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.OpenExcel*"></a>
<h4 id="GrapeCity_Wpf_SpreadSheet_GcSpreadSheet_OpenExcel_System_IO_Stream_GrapeCity_Spreadsheet_IO_OpenXml_ImportContext_" data-uid="GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.OpenExcel(System.IO.Stream,GrapeCity.Spreadsheet.IO.OpenXml.ImportContext)">OpenExcel(Stream, ImportContext)</h4>
<div class="markdown level1 summary"><p>Opens an Excel file and loads it into Spread.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public bool OpenExcel(Stream stream, ImportContext context)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function OpenExcel(stream As Stream, context As ImportContext) 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>Stream that contains an Excel file.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="../GrapeCity.Spreadsheet/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/GrapeCity.Spreadsheet.IO.OpenXml.ImportContext.html">ImportContext</a> object indicating the settings to open.</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 the file is opened successful; otherwise, <code>false</code>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
