Detect changes to Pivot Table axis

  • Thread starter rusty cranbrook
  • Start date
R

rusty cranbrook

A pivot table has a ViewChange event. That event has a parameter
called Reason which returns a value corresponding to one of the
PivotViewReasonEnum constants. ViewChange seems to be fired by many
interactions... which is fine, but how do I narrow it down to a change
in any of the axis fields, what I mean is a reconfiguration of the way
that the fields are arrayed on the pivot table. I've found that
plViewReasonDataChange (Reason = 2) is always fired for those changes,
but seems difficult to work with, as some changes fire the event twice
and some once.

Also, in programatically populating the pivot table, which has one
row, column, filter, and detail fields, ViewChange is fired a total of
12 times. Some extra ViewChange events I'd expect, as I'm also
refreshing the pivot table, but 12? Why are all these events being
fired?

Plus if a messagebox is made to open for each ViewChange
plViewReasonDataChange event, I see the pivot table go through many
configurations which I don't understand before it arrives at the final
config. Can anyone explain what is going on?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top