title | keywords | f1_keywords | ms.service | ms.assetid | ms.date | ms.localizationpriority | |
---|---|---|---|---|---|---|---|
Report.Delete method (Project) |
vbapj.chm132549 |
|
project-server |
8a6b35c1-8552-b1be-2823-913790825a82 |
06/08/2017 |
medium |
Deletes the report.
expression.Delete
expression A variable that represents a 'Report' object.
Nothing
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
[!includeSupport and feedback]