When you open a workbook and the user first re-excutes a query torefresh data, should you delete the pivotcache?Is it possible to delete a pivotcache in VBA.Or should you add a new one?
Yes, it is possible to delete a pivot cache using VBA.I don't know why you would want to add a new one, unless maybe you deleted theold one.My understanding is that a pivot refresh after your "re-query" is all that isrequired. I do this all the time in VBA except my "re-query" is copying anExcel sheet from another workbook (which actually is a re-fresh from Oracle).