Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 1.24 KB

Project.report.delete.md

File metadata and controls

56 lines (35 loc) · 1.24 KB
title keywords f1_keywords ms.service ms.assetid ms.date ms.localizationpriority
Report.Delete method (Project)
vbapj.chm132549
vbapj.chm132549
project-server
8a6b35c1-8552-b1be-2823-913790825a82
06/08/2017
medium

Report.Delete method (Project)

Deletes the report.

Syntax

expression.Delete

expression A variable that represents a 'Report' object.

Return value

Nothing

Example

The following example determines whether a report named Report 1 exists, and if so, deletes the report. If the report is active, change to another view before you delete it; otherwise, Project shows run-time error 1004: The table "Report 1" is in use and cannot be copied or deleted.

Sub DeleteAReport()
    Dim reportName As String
    
    reportName = "Report 1"
    
    If ActiveProject.Reports.IsPresent(reportName) Then
        ' To delete the active report, change to another view.
        ViewApplyEx Name:="&Gantt Chart"
        
        ActiveProject.Reports(reportName).Delete
    Else
        MsgBox Prompt:="No report name: " & reportName, Title:="Report delete error"
    End If
End Sub

See also

Report Object

[!includeSupport and feedback]