I am having an issue I can't seem to resolve. I can't seem to remove, via VBA, a pivot field that is a formula. I recorded this macro of me adding and removing it and I turn around and run it and it fails on the removal(xlHidden) with a 1004:
' Macro1 Macro
ActiveSheet.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("Rate - OF - Error"), _
"Sum of Rate - OF - Error", xlSum
ActiveSheet.PivotTables("PivotTable1").PivotFields("Rate - OF - Error") _
.Orientation = xlHidden
One would think that I should add (or the macro record) "sum of" to the string for removal but that doesn't work either.
Any help would be appreciated.