- Joined
- Feb 8, 2002
- Messages
- 3,392
- Office Version
- 365
- Platform
- Windows
How does a PivotCache get deleted from memory?
I have a procedure that defines a pivot cache and builds two pivot tables. Another procedure modifies the pivot tables. When that procedure is complete, it clears the pivot tables with
There doesn't seem to be anyway to explicity clear the pivot table cache. I initially thought I didn't have to worry about it, but now I am starting to see memory errors after a day of running these reports.
After deleting the above pivot tables, this code seems to indicate that the PivotCache is gone. There are no messages generated from this:
Rather than leave this to chance, I would like a way to explicity clear the memory from the pivotcache.
Bill
_________________
MrExcel.com Consulting
This message was edited by MrExcel on 2002-05-17 06:53
I have a procedure that defines a pivot cache and builds two pivot tables. Another procedure modifies the pivot tables. When that procedure is complete, it clears the pivot tables with
Code:
PT.TableRange2.Clear
PT2.TableRange2.Clear
There doesn't seem to be anyway to explicity clear the pivot table cache. I initially thought I didn't have to worry about it, but now I am starting to see memory errors after a day of running these reports.
After deleting the above pivot tables, this code seems to indicate that the PivotCache is gone. There are no messages generated from this:
Code:
For Each pc In ActiveWorkbook.PivotCaches
MsgBox pc.MemoryUsed
Next pc
Rather than leave this to chance, I would like a way to explicity clear the memory from the pivotcache.
Bill
_________________
MrExcel.com Consulting
This message was edited by MrExcel on 2002-05-17 06:53