[Solved] SpreadSheet Listener

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
twilli3141
Posts: 20
Joined: Tue Feb 23, 2010 12:22 am

[Solved] SpreadSheet Listener

Post by twilli3141 »

Hello:

I need to be able to set up a SpreadSheet with a listener that can detect changes to any cell on the SpreadSheet.

I then need to be able to identify the cell that changed and send out the new data to a separate process.

Based on the documentation, I cannot see how to set up a listener which will notify me of changes to the spreadsheet contents - much less identify the cell - but I am sure it must be possible.

Can anyone provide any pointers?

Thanks and Regards.
Last edited by twilli3141 on Wed Feb 24, 2010 2:33 am, edited 4 times in total.
OpenOffice 3.1.1 on Windows XP
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: SpreadSheet Listener

Post by Villeroy »

Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
twilli3141
Posts: 20
Joined: Tue Feb 23, 2010 12:22 am

Re: [UnSolved] SpreadSheet Listener

Post by twilli3141 »

Thanks Villeroy:

The XModifyListener was a huge help, however it is impractical to register a listener with every XCell.

If I register the listener with the XSpreadsheet, I get the event of course, but I cannot detect the cell which triggered the event - or it's new contents.

Any idea how I can detect changes and new contents of individual cells without creating an infinite number of listeners?

Regards.
OpenOffice 3.1.1 on Windows XP
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: SpreadSheet Listener

Post by Villeroy »

A range of cells, a sheet or multiple ranges of cells/sheets can also get such listeners.

Simple alternative in some cases: http://user.services.openoffice.org/en/ ... 51#p126951
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
twilli3141
Posts: 20
Joined: Tue Feb 23, 2010 12:22 am

Re: SpreadSheet Listener

Post by twilli3141 »

I'll take that to mean there is no way to register a single listener and extract the changed cell from the EventObject.

Assigning listeners to individual ranges will not be ideal, but it will do in a pinch - I'll simply have to limit the number of working columns a user may modify and send out the entire row for every change.

An interface such as XLastCellChanged would be a cool future addition.

Marking as [Solved] - thanks.
OpenOffice 3.1.1 on Windows XP
Post Reply