[]
Removes the specified PivotTable from the slicer cache association list.
void RemovePivotTable(IPivotTable pivotTable)
Sub RemovePivotTable(pivotTable As IPivotTable)
| Type | Name | Description |
|---|---|---|
| IPivotTable | pivotTable | The PivotTable to remove from the slicer cache association list. |
IRange source = worksheet.Range["A1:B3"];
source.Value = new object[,] {
{"Product", "Amount"},
{"A", 10},
{"B", 20}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(source);
IPivotTable pivotTable1 = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "PivotTable1");
IPivotTable pivotTable2 = worksheet.PivotTables.Add(pivotCache, worksheet.Range["H1"], "PivotTable2");
ISlicerCache cache = workbook.SlicerCaches.Add(pivotTable1, "Product");
cache.PivotTables.AddPivotTable(pivotTable2);
cache.PivotTables.RemovePivotTable(pivotTable2);
int count = cache.PivotTables.Count;