# GrapeCity.Spreadsheet.Slicers.ISlicers.Add

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Spreadsheet_Slicers_ISlicers_Add_" data-uid="GrapeCity.Spreadsheet.Slicers.ISlicers.Add*">Add Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Spreadsheet_Slicers_ISlicers_Add_" data-uid="GrapeCity.Spreadsheet.Slicers.ISlicers.Add*"></a>
<h4 id="GrapeCity_Spreadsheet_Slicers_ISlicers_Add_GrapeCity_Spreadsheet_IWorksheet_System_String_System_String_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="GrapeCity.Spreadsheet.Slicers.ISlicers.Add(GrapeCity.Spreadsheet.IWorksheet,System.String,System.String,System.Int32,System.Int32,System.Int32,System.Int32)">Add(IWorksheet, string, string, int, int, int, int)</h4>
<div class="markdown level1 summary"><p>Creates a new slicer.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">ISlicer Add(IWorksheet worksheet, string name = null, string caption = null, int x = -1, int y = -1, int width = -1, int height = -1)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Add(worksheet As IWorksheet, Optional name As String = Nothing, Optional caption As String = Nothing, Optional x As Integer = -1, Optional y As Integer = -1, Optional width As Integer = -1, Optional height As Integer = -1) As ISlicer</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="GrapeCity.Spreadsheet.IWorksheet.html">IWorksheet</a></td>
      <td><span class="parametername">worksheet</span></td>
      <td><p>A <a class="xref" href="GrapeCity.Spreadsheet.IWorksheet.html">IWorksheet</a> object where the resulting slicer will be placed.
The destination sheet must be in the workbook that contains the Slicers object specified by expression.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">name</span></td>
      <td><p>The name of the slicer. Spread automatically generates a name if the parameter is missing. The name must be unique across all slicers within 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">caption</span></td>
      <td><p>The caption of the slicer.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>The initial horizontal position of the slicer, in pixels, relative to the upper-left corner of cell A1 on a 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">y</span></td>
      <td><p>The initial vertical position of the slicer, in pixels, relative to the upper-left corner of cell A1 on a 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">width</span></td>
      <td><p>The initial width, in pixels, of the slicer control.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">height</span></td>
      <td><p>The initial height, in pixels, of the slicer control.</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.Slicers.ISlicer.html">ISlicer</a></td>
      <td><p>The created <a class="xref" href="GrapeCity.Spreadsheet.Slicers.ISlicer.html">ISlicer</a> object.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
