# GrapeCity.Documents.Excel.Workbook.ImportData

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_Workbook_ImportData_" data-uid="GrapeCity.Documents.Excel.Workbook.ImportData*">ImportData Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_Workbook_ImportData_" data-uid="GrapeCity.Documents.Excel.Workbook.ImportData*"></a>
<h4 id="GrapeCity_Documents_Excel_Workbook_ImportData_System_String_System_String_" data-uid="GrapeCity.Documents.Excel.Workbook.ImportData(System.String,System.String)">ImportData(string, string)</h4>
<div class="markdown level1 summary"><p>Import all the data of the specified source of the file.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static object[,] ImportData(string fileName, string sourceName)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function ImportData(fileName As String, sourceName As String) As Object(,)</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 path and name for the file.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">sourceName</span></td>
      <td><p>The name of the data source. The source name could be:<br><b>worksheet</b> &quot;Sheet1&quot;<br><b>table</b> &quot;Sheet1!Table1&quot;<br><b>range</b> &quot;Sheet1!A1:C5&quot;</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.object">object</a>[,]</td>
      <td><p>An array for the data.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Excel_Workbook_ImportData_" data-uid="GrapeCity.Documents.Excel.Workbook.ImportData*"></a>
<h4 id="GrapeCity_Documents_Excel_Workbook_ImportData_System_String_System_String_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="GrapeCity.Documents.Excel.Workbook.ImportData(System.String,System.String,System.Int32,System.Int32,System.Int32,System.Int32)">ImportData(string, string, int, int, int, int)</h4>
<div class="markdown level1 summary"><p>Import the data of a specified range from a file.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static object[,] ImportData(string fileName, string worksheetName, int row, int column, int rowCount, int columnCount)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function ImportData(fileName As String, worksheetName As String, row As Integer, column As Integer, rowCount As Integer, columnCount As Integer) As Object(,)</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 path and name for the file.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">worksheetName</span></td>
      <td><p>The name of the worksheet.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">row</span></td>
      <td><p>The first row of the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">column</span></td>
      <td><p>The first column of the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">rowCount</span></td>
      <td><p>The count of the rows.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">columnCount</span></td>
      <td><p>The count of the columns.</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.object">object</a>[,]</td>
      <td><p>An array for the data.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Excel_Workbook_ImportData_" data-uid="GrapeCity.Documents.Excel.Workbook.ImportData*"></a>
<h4 id="GrapeCity_Documents_Excel_Workbook_ImportData_System_IO_Stream_System_String_" data-uid="GrapeCity.Documents.Excel.Workbook.ImportData(System.IO.Stream,System.String)">ImportData(Stream, string)</h4>
<div class="markdown level1 summary"><p>Import all the data of the specified source of the file.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static object[,] ImportData(Stream fileStream, string sourceName)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function ImportData(fileStream As Stream, sourceName As String) As Object(,)</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">fileStream</span></td>
      <td><p>The fileStream of a 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">sourceName</span></td>
      <td><p>The name of the data source. The source name could be:<br><b>worksheet</b> &quot;Sheet1&quot;<br><b>table</b> &quot;Sheet1!Table1&quot;<br><b>range</b> &quot;Sheet1!A1:C5&quot;</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.object">object</a>[,]</td>
      <td><p>An array for the data.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Excel_Workbook_ImportData_" data-uid="GrapeCity.Documents.Excel.Workbook.ImportData*"></a>
<h4 id="GrapeCity_Documents_Excel_Workbook_ImportData_System_IO_Stream_System_String_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="GrapeCity.Documents.Excel.Workbook.ImportData(System.IO.Stream,System.String,System.Int32,System.Int32,System.Int32,System.Int32)">ImportData(Stream, string, int, int, int, int)</h4>
<div class="markdown level1 summary"><p>Import the data of a specified range from a fileStream.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static object[,] ImportData(Stream fileStream, string worksheetName, int row, int column, int rowCount, int columnCount)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function ImportData(fileStream As Stream, worksheetName As String, row As Integer, column As Integer, rowCount As Integer, columnCount As Integer) As Object(,)</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">fileStream</span></td>
      <td><p>The fileStream of a 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">worksheetName</span></td>
      <td><p>The name of the worksheet.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">row</span></td>
      <td><p>The first row of the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">column</span></td>
      <td><p>The first column of the range.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">rowCount</span></td>
      <td><p>The count of the rows.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">columnCount</span></td>
      <td><p>The count of the columns.</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.object">object</a>[,]</td>
      <td><p>An array for the data.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
