S
seed
Put together a quick macro to assemble a pivotchart, nothing fancy just ran
through it recording and tried to run it on the same data afterwards, and
have come upon this error:
Run-time error '1004':
Unable to get the PivotFields property of the pivottable class
When I go to debug, the error is occurring at the asterisked line:
Cells.Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"'Check results'!C1:C5").CreatePivotTable TableDestination:="",
TableName:= _
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
Charts.Add
ActiveChart.Location Where:=xlLocationAsNewSheet
* With ActiveChart.PivotLayout.PivotTable.PivotFields("TEST_LOCATION")
.Orientation = xlPageField
.Position = 1
End With
Is there a workaround? Something I've missed?
Thanks,
Ryan
through it recording and tried to run it on the same data afterwards, and
have come upon this error:
Run-time error '1004':
Unable to get the PivotFields property of the pivottable class
When I go to debug, the error is occurring at the asterisked line:
Cells.Select
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"'Check results'!C1:C5").CreatePivotTable TableDestination:="",
TableName:= _
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
Charts.Add
ActiveChart.Location Where:=xlLocationAsNewSheet
* With ActiveChart.PivotLayout.PivotTable.PivotFields("TEST_LOCATION")
.Orientation = xlPageField
.Position = 1
End With
Is there a workaround? Something I've missed?
Thanks,
Ryan