Class SlicerCaches (Excel VBA)

The class SlicerCaches represents the collection of slicer caches associated with the specified workbook. To use a SlicerCaches class variable it first needs to be instantiated, for example


Dim scs as SlicerCaches
Set scs = ActiveWorkbook.SlicerCaches

For Each

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


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

Add2

Add2 (Source, SourceField, Name, SlicerCacheType)


Dim slcAdd2 As SlicerCache
Set slcAdd2 = ActiveWorkbook.SlicerCaches.Add2(Source:=, SourceField:=)

Arguments

The following arguments are required:

Source

SourceField

Optional arguments

The following arguments are optional

Name

SlicerCacheType

Count

Returns the number of objects in the collection.


Dim lngCount As Long
lngCount = ActiveWorkbook.SlicerCaches.Count

Item

Returns a single SlicerCache object from the collection.

Item (Index)

Index: The name or index number of the object.


Dim slcItem As SlicerCache
Set slcItem = ActiveWorkbook.SlicerCaches(Index:=1)