Chart.SetElement Method
Sets chart elements on a chart. Read/write MsoChartElementType.
Version Information
Version Added: Excel
Syntax
expression.SetElement(Element)
expression A variable that represents a Chart object.
Parameters
| Name | Required/Optional | Data Type | Description |
|---|---|---|---|
| Element | Required | MsoChartElementType | Specifies the chart element type. |
Return Value
Nothing
Remarks
For charts, the following commands in the Layout tab correspond to the SetElement method:
- Everything in the
Labelsgroup. - Everything in the
Axesgroup. - Everything in the
Analysisgroup. PlotArea,Chart Wall, andChart Floorbuttons.
MsoChartElementType is an enumeration of constants that refer to all of the above commands.
Example
This example sets chart elements using the various constant values to an active chart.
| Visual Basic for Applications |
|---|
|