Pivot Cache Object and the Pivot Caches Collection Example

Sub RefreshPivotCache() Dim oPC As PivotCache

Set oPC = ActiveWorkbook.PivotCaches(1) With oPC

'Only refresh if the data is over 1 hour old

PivotCell Object

If .RefreshDate < Now - TimeValue("01:00:00":

Then

.Refresh

End If

End With

End Sub

0 0

Post a comment