Skip to content

Instantly share code, notes, and snippets.

@ateneva
Last active March 3, 2018 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ateneva/98929ef8332c193f52ed937c8e61813c to your computer and use it in GitHub Desktop.
Save ateneva/98929ef8332c193f52ed937c8e61813c to your computer and use it in GitHub Desktop.
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"
Else
'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