# GrapeCity.Documents.Excel.ICustomXmlPartCollection.Remove

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_ICustomXmlPartCollection_Remove_" data-uid="GrapeCity.Documents.Excel.ICustomXmlPartCollection.Remove*">Remove Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_ICustomXmlPartCollection_Remove_" data-uid="GrapeCity.Documents.Excel.ICustomXmlPartCollection.Remove*"></a>
<h4 id="GrapeCity_Documents_Excel_ICustomXmlPartCollection_Remove_System_String_" data-uid="GrapeCity.Documents.Excel.ICustomXmlPartCollection.Remove(System.String)">Remove(string)</h4>
<div class="markdown level1 summary"><p>Removes the Custom XML part with the specified ID.</p>
<p>
If no part with the specified ID exists, the collection is not changed.
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void Remove(string id)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub Remove(id As String)</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">id</span></td>
      <td><p>The ID of the Custom XML part to remove.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Documents_Excel_ICustomXmlPartCollection_Remove_System_String__examples">Examples</h5>
<pre><code class="lang-csharp">ICustomXmlPart customXmlPart = workbook.CustomXmlParts.Add();
string id = customXmlPart.Id;

workbook.CustomXmlParts.Remove(id);</code></pre>



<a id="GrapeCity_Documents_Excel_ICustomXmlPartCollection_Remove_" data-uid="GrapeCity.Documents.Excel.ICustomXmlPartCollection.Remove*"></a>
<h4 id="GrapeCity_Documents_Excel_ICustomXmlPartCollection_Remove_System_Int32_" data-uid="GrapeCity.Documents.Excel.ICustomXmlPartCollection.Remove(System.Int32)">Remove(int)</h4>
<div class="markdown level1 summary"><p>Removes the Custom XML part at the specified zero-based index.</p>
<p>
If the index is outside the valid range, the collection is not changed.
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">void Remove(int index)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Sub Remove(index As Integer)</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.int32">int</a></td>
      <td><span class="parametername">index</span></td>
      <td><p>The zero-based index of the Custom XML part to remove.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Documents_Excel_ICustomXmlPartCollection_Remove_System_Int32__examples">Examples</h5>
<pre><code class="lang-csharp">if (workbook.CustomXmlParts.Count &gt; 0)
{
    workbook.CustomXmlParts.Remove(0);
}</code></pre>

</div>
