Am Mittwoch, den 27.09.2006, 23:56 +0200 schrieb Cor Nouws:
> Sub AddListners
>    Dim oCell
>    Const sCellName as String  = "A1"
> 
>    oCell = ThisComponent.Sheets.getByIndex(0).getCellRangeByName(sCellName)
>    oListner0 = CreateUnoListener( "A10_", 
> "com.sun.star.chart.XChartDataChangeEventListener" )
>    oCell.addChartDataChangeEventListener(oListner0)
> 
>   ' do the same for sheet(1) and (2)
> End Sub
> 
> Sub RemoveListener
>    Dim oCell
>    ' removes the listener
>    oCell = ThisComponent.Sheets.getByIndex(0).getCellByPosition(0, 0)
>    oCell.removeModifyListener(oListner0)
> *>>*
>    ' Gives "Cannot coerce argument type during corereflection call"

>From my experience this error message generally wants to tell you that
typecasting is impossible in this situation.

Since you added a "ChartDataChangeEventListener" I think removing must
be done with exactly the same type:

        oCell.removeChartDataChangeEventListener(oListner0)

should do.

>    ' do the same for other listners
> End Sub

HTH,
Marc


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to