Share via


Slicers.Add Method

Creates a new slicer and returns a Slicer object.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function Add ( _
    SlicerDestination As Object, _
    Level As Object, _
    Name As Object, _
    Caption As Object, _
    Top As Object, _
    Left As Object, _
    Width As Object, _
    Height As Object _
) As Slicer
'Usage
Dim instance As Slicers
Dim SlicerDestination As Object
Dim Level As Object
Dim Name As Object
Dim Caption As Object
Dim Top As Object
Dim Left As Object
Dim Width As Object
Dim Height As Object
Dim returnValue As Slicer

returnValue = instance.Add(SlicerDestination, _
    Level, Name, Caption, Top, Left, Width, _
    Height)
Slicer Add(
    Object SlicerDestination,
    Object Level,
    Object Name,
    Object Caption,
    Object Top,
    Object Left,
    Object Width,
    Object Height
)

Parameters

  • SlicerDestination
    Type: System.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
    Type: System.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
    Type: System.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.

  • Top
    Type: System.Object

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

  • Left
    Type: System.Object

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

  • Width
    Type: System.Object

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

  • Height
    Type: System.Object

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

Return Value

Type: Microsoft.Office.Interop.Excel.Slicer
A Slicer object.

See Also

Reference

Slicers Interface

Slicers Members

Microsoft.Office.Interop.Excel Namespace