SlicerCache 对象 (Excel)SlicerCache object (Excel)

表示切片器的当前筛选状态以及切片器连接到的**PivotCache** 或**WorkbookConnection** 对象的相关信息。Represents the current filter state for a slicer, and information about which PivotCache or WorkbookConnection object the slicer is connected to.

备注Remarks

使用工作簿对象的**SlicerCaches** 属性可访问工作簿中SlicerCache对象的**SlicerCaches** 集合。Use the SlicerCaches property of the Workbook object to access the SlicerCaches collection of SlicerCache objects in a workbook.

每个切片器都有一个 base SlicerCache对象, 该对象表示切片器中显示的项目以及显示的图块的当前用户界面状态与其对应的项目标题。Each slicer has a base SlicerCache object that represents the items displayed in the slicer and the current user interface state of the tiles displayed with their corresponding item captions. 用户在 Excel 中看到的每个切片器控件均由一个**切片器** 对象表示, 该对象包含一个与之关联的SlicerCache对象。Each slicer control that the user sees in Excel is represented by a Slicer object that has a SlicerCache object associated with it.

示例Example

下面的代码示例基于 Customer Geography OLAP 层次结构, 从与 AdventureWorks 数据库的连接创建一个SlicerCache对象, 然后在工作簿的 Sheet2 中的该层次结构的国家/地区级别上创建一个切片器。The following code example creates a SlicerCache object based on the Customer Geography OLAP hierarchy from the connection to the AdventureWorks database, and then creates a slicer on the Country level of that hierarchy in Sheet2 of the workbook.

With ActiveWorkbook 
 .SlicerCaches.Add("AdventureWorks", _ 
 "[Customer].[Customer Geography]").Slicers.Add SlicerDestination:="Sheet2", _ 
 Level:="[Customer].[Customer Geography].[Country]", Caption:="Country" 
End With 

方法Methods

属性Properties

另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.