Chart.ApplyCustomType method (Project)
Applies a custom chart type to a chart.
Syntax
expression. ApplyCustomType
(ChartType, TypeName)
expression A variable that represents a Chart object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
ChartType | Required | Office.XlChartType | The type of chart. |
TypeName | Optional | Variant | The name of the chart type. |
ChartType | Required | XLCHARTTYPE | |
TypeName | Optional | Variant |
Return value
Nothing
Example
The following example changes the chart type to a clustered 3D bar chart.
Sub SetChartType()
Dim chartShape As Shape
Dim reportName As String
reportName = "Simple scalar chart"
Set chartShape = ActiveProject.Reports(reportName).Shapes(1)
Debug.Print "Chart type before: " & chartShape.Chart.ChartType
chartShape.Chart.ApplyCustomType (xl3DBarClustered)
Debug.Print "Chart type after: " & chartShape.Chart.ChartType
End Sub
See also
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.