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?