# GrapeCity.Documents.Excel.ISlicerCaches.Add

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_ISlicerCaches_Add_" data-uid="GrapeCity.Documents.Excel.ISlicerCaches.Add*">Add Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_ISlicerCaches_Add_" data-uid="GrapeCity.Documents.Excel.ISlicerCaches.Add*"></a>
<h4 id="GrapeCity_Documents_Excel_ISlicerCaches_Add_System_Object_System_String_System_String_" data-uid="GrapeCity.Documents.Excel.ISlicerCaches.Add(System.Object,System.String,System.String)">Add(object, string, string)</h4>
<div class="markdown level1 summary"><p>Adds a new <a class="xref" href="GrapeCity.Documents.Excel.ISlicerCache.html">ISlicerCache</a> object to the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">ISlicerCache Add(object source, string sourceField, string name = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Add(source As Object, sourceField As String, Optional name As String = Nothing) As ISlicerCache</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.object">object</a></td>
      <td><span class="parametername">source</span></td>
      <td><p>The data source that the new <a class="xref" href="GrapeCity.Documents.Excel.ISlicerCache.html">ISlicerCache</a> will be based on.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">sourceField</span></td>
      <td><p>The name of the field in the data source to filter by.</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 uses to reference the slicer cache (the value of the <a class="xref" href="GrapeCity.Documents.Excel.ISlicerCache.html">ISlicerCache</a>.Name property).</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.Documents.Excel.ISlicerCache.html">ISlicerCache</a></td>
      <td><p>Returns <a class="xref" href="GrapeCity.Documents.Excel.ISlicerCache.html">ISlicerCache</a>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
