In an Excel file I have a pivot table with a named range as datasource. The pivot table has 3 values (measure) and year, quarter and month in columns. I import data into the datasheet, update the named range and call RefreshData and CalculateData on the pivot table.
If I collapse either year or quarter I get a System.ArgumentOutOfRangeException exception when calling CalculateData.
If I expand year and quarter CalculateData does not produce an exception.
Can I in code expand all column fields then call CalculateData and then collapse all/some column fields again?
It appears as if only when the pivot has multiple Values does the exception occur