Chart.ChartColor property (Project)

Gets or sets the index of chart colors for the active chart. Read/write Variant.

Syntax

expression. ChartColor

expression A variable that represents a Chart object.

Remarks

The ChartColor property corresponds to a selection in the Change Colors drop-down list, which is on the ribbon under Chart Tools, on the Format tab, in the ChartStyles group.

Note

The Colors drop-down list on the ribbon under REPORT TOOLS, on the DESIGN tab, in the Themes group, changes the color theme of the entire report, including any charts on the report. The VBA object model in Project does not support the control for report theme colors.

Example

In the following example, the chart is the first shape in the "Simple scalar chart" report. The example sets the chart color scheme to monochromatic greens.

Sub SetChartColor()
    Dim chartShape As Shape
    
    Set chartShape = ActiveProject.Reports("Simple scalar chart").Shapes(1)
    
    ' ChartColor values 10 - 26 correspond to the Change Colors menu
    ' on the DESIGN tab of the CHART TOOLS ribbon.
    chartShape.Chart.ChartColor = 26
End Sub

Property value

VARIANT

See also

Chart Object

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.