1
votes

I have a pivot table that has a connection to a query in the workbook to serve as the data source. When I try to write the following VBA code:

ActiveSheet.PivotTables("PivotTable1").PivotFields("Sum of Income").Calculation = xlNormal,

I get runtime error:

'1004' - unable to get the pivotfields property of the pivottable class.

Is this because I have an error in my code or because I'm not using a regular data source?

1
Validate pivot table name "PivotTable1" and pivot field name "Sum of Income"Unknown

1 Answers

0
votes

It would seem your code isn't able to reach the .Calcuation propertie. Try to use a macro recorder to check if your names are valid when you use this code.

My guess is that "Sum of Income" is the source of this error in your case.