Chart.Delete method (Project)
Deletes a chart on an active report.
expression.Delete
expression A variable that represents a Chart object.
Variant
The following example displays a report, and then deletes all charts on the report.
Sub DeleteCharts()
Dim chartReport As Report
Dim chartShape As Shape
Dim reportName As String
' Display a report.
reportName = "Chart Report 1"
Set chartReport = ActiveProject.Reports(reportName)
chartReport.Apply
' Delete every chart on the report.
For Each chartShape In chartReport.Shapes
If chartShape.Type = msoChart Then
Debug.Print "Deleting chart: '" & chartShape.Name _
& "' from report: " & reportName
chartShape.Delete
End If
Next chartShape
End Sub
Chart Object Report.Delete Method
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.