Hi
What is the syntax to delete a pivottable programatically? I tried

Dim ws As Worksheet
Dim pt As PivotTable

Set ws = ActiveWorkbook.Worksheets("unused")

Set pt = ws.PivotTables(1)
pt.Delete ' error
Set pt = Nothing

Thanks
Habib