• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to clear the Pivot Cache when Pivot Table is created using VBA

Vijaychitra

New Member
Hi, Have created a Pivot Table using VBA. For the creation of Pivot Table report, the data is organized as a list with labeled columns. No empty columns present in the data.
Also on the VBA code, have created pivot cache before creating the Pivot table. However on execution, it throws Run-time error '1004' - stating the "Pivot Table field name is not valid" and hence it doesn't create the Pivot Table.

Is there a way to clear the pivot cache and recreate it, before creating the pivot table?
 
If you created the cache in the same code, there must be an issue with the data. Either you have included a blank header column, or one of the field names really is invalid.
 
Back
Top