Hi Andreas,
Andreas Schneider wrote:
I want to implement a Calc function via AddIn, which
can also "listen" to events. I was not able to find
anything about this subject and the function calls
itself don't contain any reference to the cell it
belongs to.
There is for sure info about this in the SDK.
Pls see http://api.openoffice.org/
Is there some way to implement a listener
specific to certain cells like the default "=HYPERLINK"
function does? I'm developing an OLAP solution for
I've a litte experience with this and from that a code snippet that
shows the idea:
global oListner0 as object
'also oListner1 and oListner2
Sub Main
AddListners
End Sub
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.removeChartDataChangeEventListener(oListner0)
' do the same for other listners
End Sub
Sub A10_chartDataChanged(oEvent)
'do something
end sub
hope this is a start for you.
Best,
Cor
--
Cor Nouws
Arnhem - Netherlands
nl.OpenOffice.org - marketing contact
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]