Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How can I check if I've got different pivot caches in my workbook?
Sub CountWbkCachesAndShowWbkSize()
Dim PC As PivotCache
If ActiveWorkbook.PivotCaches.Count = 0 Then
MsgBox "The current workbook has 0 caches"
'counts the number of PivotCaches
MsgBox "The current workbook has " & ActiveWorkbook.PivotCaches.Count & " caches" _
& vbNewLine _
& "The current workbook size is " & Round(FileLen(ActiveWorkbook.FullName) / 1048576, 2) & " MB"
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.