Exception when accessing ActiveData member

R

roger.camargo

I am using the "IPivotControlEvents_DataChangeEventHandler" event.

When the event is triggered I access the ActiveData member of the
PivotTable.
And sometimes I have an exception like this:

System.Runtime.InteropServices.COMException (0x80004005): Unspecified
error
at OWC11.IPivotControl.get_ActiveData()
at AxOWC11.AxPivotTable.get_ActiveData()

More details

When I drag and drop a Dimension Field on the PivotTable Row or Column
Area from the "PivotTable Field List" everything is fine, the event
triggers 2 times with the following reasons:

1. plDataReasonIsIncludedChange

2. plDataReasonInsertFieldSet

But when I drop a Level Field on the PivotTable Row or Column Area
from the "PivotTable Field List" an Exception happens, the event
triggers 2 times with the following reasons:

1. plDataReasonInsertFieldSet (With this reason the following
exception happens when I try to use ActiveData)
ERROR System.Runtime.InteropServices.COMException (0x80004005):
Unspecified error
at OWC11.IPivotControl.get_ActiveData()
at AxOWC11.AxPivotTable.get_ActiveData()
at OWCTest.Form1.pt_DataChange(Object sender,
IPivotControlEvents_DataChangeEvent e) in d:\_compare\owctest_\owctest
\form1.cs:line 419

2. plDataReasonIsIncludedChange

When I remove the Field from the Row or Column Area using the Drag and
Drop, to an area outside the PivotTable the same Exception happens,
the event triggers N times with the following reasons:

1. plDataReasonIsIncludedChange (With this reason the following
exception happens when I try to use ActiveData)
ERROR System.Runtime.InteropServices.COMException (0x80004005):
Unspecified error
at OWC11.IPivotControl.get_ActiveData()
at AxOWC11.AxPivotTable.get_ActiveData()
at OWCTest.Form1.pt_DataChange(Object sender,
IPivotControlEvents_DataChangeEvent e) in d:\_compare\owctest_\owctest
\form1.cs:line 419
2. plDataReasonRemoveFieldSet

But when I remove it using right click and click on "Remove Field"
there isn't any exception and the event triggers 1 time with the
following reason:

1. plDataReasonRemoveFieldSet


Finally the question how can avoid the exception, why is it happening.
 

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