Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 1.26 KB

Project.chart.delete.md

File metadata and controls

62 lines (42 loc) · 1.26 KB
title keywords f1_keywords ms.service ms.assetid ms.date ms.localizationpriority
Chart.Delete method (Project)
vbapj.chm131614
vbapj.chm131614
project-server
46312c6b-db7b-7562-d97a-d1fc8ba2acb7
06/08/2017
medium

Chart.Delete method (Project)

Deletes a chart on an active report.

Syntax

expression.Delete

expression A variable that represents a Chart object.

Return value

Variant

Example

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

See also

Chart Object Report.Delete Method

[!includeSupport and feedback]