Change GetPivotData to read the pivot cache
A recent survey of the most evil Excel functions showed an unexpected (to me) result. Getpivotdata topped the list.
One of the major reasons for this is that it only works off whatever Field names are visible, so that when the user changes the visible row or column fields getpivotdata stops working.
if it read the pivotcache directly then this problem would be solved and Getpivotdata would be a lot more robust.