Slicers.Add Method

Definition

Creates a new slicer and returns a Slicer object.

public Microsoft.Office.Interop.Excel.Slicer Add (object SlicerDestination, object Level, object Name, object Caption, object Top, object Left, object Width, object Height);
Public Function Add (SlicerDestination As Object, Optional Level As Object, Optional Name As Object, Optional Caption As Object, Optional Top As Object, Optional Left As Object, Optional Width As Object, Optional Height As Object) As Slicer

Parameters

SlicerDestination
Object

A string that specifies the name of the sheet, or a Worksheet object that represents the sheet, where the resulting slicer will be placed. The destination sheet must be in the workbook that contains the Slicers object specified by expression.

Level
Object

For OLAP data sources, the ordinal or the Multidimensional Expression (MDX) name of the level on which the slicer creation is based. Not supported for non-OLAP data sources.

Name
Object

The name of the slicer. Excel automatically generates a name if one is not specified. The name must be unique across all slicers within a workbook.

Caption
Object

The caption of the slicer.

Top
Object

The initial vertical position of the slicer, in points, relative to the upper-left corner of cell A1 on a worksheet.

Left
Object

The initial horizontal position of the slicer, in points, relative to the upper-left corner of cell A1 on a worksheet.

Width
Object

The initial width, in points, of the slicer control.

Height
Object

The initial height, in points, of the slicer control.

Returns

A Slicer object.

Applies to