Runtime error 1004-Unable to get the Pivot Tables property

jsiedbald

New Member
Joined
Nov 17, 2005
Messages
1
Hi, I am trying to create three pivot tables using the pivot table cache to make the workbook smaller.

The first and second pivot tables run with no problems but has soon as I try to create the third pivot table it brings up a debug error "Run-time 1004: Unable to get the Pivot Table property of the Worksheet class"

Please help!!! I need this for a report that I run at work.

Thanks Jolene
*************************
NBO Resolved Calls = Raw Data
Sheet1 = First Pivot Table
Sheet2 = Second Pivot Table

First pivot table code:
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"NBO Resolved Calls!A:V").CreatePivotTable TableDestination:="", TableName _
:="PivotTable3", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select[/b][/b]

Second pivot table code:
Sheets("Sheet1").Select
Cells.Select
ActiveWorkbook.Worksheets("Sheet1").PivotTables("PivotTable3").PivotCache. _
CreatePivotTable TableDestination:="", TableName:="PivotTable4", _
DefaultVersion:=xlPivotTableVersion10

Third pivot tabel code Sheets("Sheet2").Select
ActiveWorkbook.Worksheets("Sheet2").PivotTables("PivotTable3").PivotCache. _
CreatePivotTable TableDestination:="", TableName:="PivotTable5", _
DefaultVersion:=xlPivotTableVersion10
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,203,465
Messages
6,055,579
Members
444,799
Latest member
CraigCrowhurst

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