Class SlicerCache (Excel VBA)

The class SlicerCache represents the current filter state for a slicer, and information about which PivotCache or WorkbookConnection object the slicer is connected to.

The main procedure of class SlicerCache is Delete


To use a SlicerCache class variable it first needs to be instantiated, for example

Dim slc as SlicerCache
Set slc = ActiveWorkbook.SlicerCaches(Index:=1)

The following procedures can be used to set variables of type SlicerCache: Slicer.SlicerCache, SlicerCacheLevel.Parent, SlicerCaches.Item, SlicerCaches.Add2, SlicerItem.Parent, SlicerItems.Parent and Workbook.SlicerCaches

For Each

Here is an example of processing the SlicerCache items in a collection.

Dim slc As SlicerCache
For Each slc In ActiveWorkbook.SlicerCaches
Next slc


The following procedures in this class have been grouped together and are described on a separate theme page

Sort/Order with its procedures SortItems and SortUsingCustomLists


This is the main method of the SlicerCache class

Delete - Deletes the specified slicer cache and the slicers associated with it.


Other Methods

ClearAllFilters - Clears the filter for either slicer or timeline, depending on the slicer cache type.

ClearDateFilter - Clears the filter for a timeline (date filter).

ClearManualFilter - Clears the manual filter for the slicer cache.


CrossFilterType returns or sets whether a slicer is participating in cross filtering with other slicers that share the same slicer cache, and how cross filtering is displayed.

FilterCleared returns whether the slicer or timeline filter state is cleared.

Index returns the index of the specified SlicerCache object in the SlicerCaches collection.

List true if the slicer cache is for a slicer on a table; otherwise, False.

ListObject returns a ListObject object for the QueryTable object.

Name returns or sets the name of the slicer cache.

OLAP returns whether the slicer associated with the specified slicer cache is based on an OLAP data source.

Parent returns the parent SlicerCaches object for the specified SlicerCache object. Read-only.

PivotTables returns a SlicerPivotTables collection that contains information about the PivotTables that the slicer cache is currently filtering.

RequireManualUpdate true when manual updates of the slicer cache are required.

ShowAllItems returns or sets whether slicers connected to the specified slicer cache display items that have been deleted from the corresponding PivotCache.

SlicerCacheLevels returns the collection of SlicerCacheLevel objects that represent the levels of an OLAP hierarchy on which the specified slicer cache is based.

SlicerCacheType returns the type of the slicer cache: slicer (xlSlicer) or timeline (xlTimeline) .

SlicerItems returns a SlicerItems collection that contains the collection of all items in the slicer cache.

Slicers returns a Slicers collection that contains the collection of Slicer objects associated with the specified SlicerCache object.

SourceName returns the name of the data source that the slicer is connected to.

SourceType returns the kind of data source that the slicer is connected to.

TimelineState the timeline-specific state of the SlicerCache object.

VisibleSlicerItems returns a SlicerItems collection that contains the collection of all the visible items in the specified slicer cache.

VisibleSlicerItemsList returns or sets the list of MDX unique names for members at all levels of the hierarchy where manual filtering is applied.

WorkbookConnection gets or sets the WorkbookConnection object that represents the data connection used by the specified slicer.

SlicerCaches.Count returns the number of objects in the collection.

SlicerCaches.Item returns a single SlicerCache object from the collection.

SlicerCaches.Parent returns the parent Workbook object for the collection. Read-only.