limpar cache tabela dinamica excel 2013
Enviado: 07 Nov 2016 às 08:46
prezados tenho esse codigo que limpa o cache de tabela dinamica do excel 2003, no entanto no 2013 não funciona apresenta o Erro em tempo de execução 1004, alguma dica?
Sub DeleteMissingItems2002All()
Dim pt As PivotTable
Dim ws As Worksheet
Dim pc As PivotCache
For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.PivotCache.MissingItemsLimit = xlMissingItemsNone
Next pt
Next ws
For Each pc In ActiveWorkbook.PivotCaches
On Error Resume Next
pc.Refresh
Next pc
End Sub
Sub DeleteMissingItems2002All()
Dim pt As PivotTable
Dim ws As Worksheet
Dim pc As PivotCache
For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.PivotCache.MissingItemsLimit = xlMissingItemsNone
Next pt
Next ws
For Each pc In ActiveWorkbook.PivotCaches
On Error Resume Next
pc.Refresh
Next pc
End Sub