Chart.ChartTitle property (Project)
Gets an Office.IMsoChartTitle object that represents the title of the specified chart. Read-only IMsoChartTitle.
Syntax
expression. ChartTitle
expression A variable that represents a Chart object.
Remarks
To manually edit the text of a chart title, click in the title area. To change the title format, select the chart, and then, on the ribbon under CHART TOOLS, choose the FORMAT tab.
Example
The following example changes the chart title and sets the title above the chart.
Sub ChangeChartTitle()
Dim chartShape As Shape
Set chartShape = ActiveProject.Reports("Simple scalar chart").Shapes(1)
With chartShape.Chart
If Not .HasTitle Then
.HasTitle = True
End If
.ChartTitle.Text = "New chart title"
.SetElement (msoElementChartTitleAboveChart)
End With
End Sub
Property value
IMSOCHARTTITLE
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.