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
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