Pivot Cache with VBA

Misca

Well-known Member
Joined
Aug 12, 2009
Messages
1,749
Office Version
  1. 365
Platform
  1. Windows
Working with a few hundred thousand rows of data on Excel 2010 but I can't get my macro to create a PivotCache / PivotTable from my data. The code I'm using is
Code:
Dim PC as PivotCache
 
Set PC = ActiveWorkbook.PivotCaches.Add(xlDatabase, Sheet1.Range("A1").CurrentRegion)
It works fine as long as there's less than 65 536 rows of data but not with my whole data set.

If I create the PivotTable manually, everything works fine but when I record a macro to see what it says, it's more or less the same (using ".Create" instead of ".Add") but if I try to run the recorded macro it crashes again.

Can anybody help me get around this?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,215,737
Messages
6,126,563
Members
449,318
Latest member
Son Raphon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top