View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
HSalim[MVP] HSalim[MVP] is offline
external usenet poster
 
Posts: 70
Default Delete pivot table

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