SlicerCache.WorkbookConnection property (Excel)

Gets or sets the WorkbookConnection object that represents the data connection used by the specified slicer. Read/write.

Syntax

expression.WorkbookConnection

expression A variable that represents a SlicerCache object.

Return value

WorkbookConnection

Remarks

The WorkbookConnection property only applies to slicers that are based on external data sources (SlicerCache.SourceType = xlExternal).

Attempting to access the WorkbookConnection property for slicers that are connected to PivotTables based on workbook ranges or lists (SlicerCache.SourceType = xlDatabase) generates a run-time error.

The workbook connection value must be unique. Setting the workbook connection to a value that already exists generates a run-time error.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.