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.ObjectA 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.ObjectFor 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.ObjectThe 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
Type: System.ObjectThe caption of the slicer.
Top
Type: System.ObjectThe initial vertical position of the slicer, in points, relative to the upper-left corner of cell A1 on a worksheet.
Left
Type: System.ObjectThe initial horizontal position of the slicer, in points, relative to the upper-left corner of cell A1 on a worksheet.
Width
Type: System.ObjectThe initial width, in points, of the slicer control.
Height
Type: System.ObjectThe initial height, in points, of the slicer control.
Return Value
Type: Microsoft.Office.Interop.Excel.Slicer
A Slicer object.