Re: How to handle OnSelect event on sheet ?
Niklas Nebel <[email protected]> Tue, 25 Jan 2011 21:37:13 +0100
| Newsgroups | gmane.comp.openoffice.devel.api |
|---|---|
| Message-ID | <[email protected]> |
Bernard Marcelly schrieb:
> I am trying to attach a macro to the sheet events available in OOo 3.3
> (by a right-click on the sheet tab).
>
> With the OnSelect event, if the called macro displays a message you go
> into an endless loop because, once the message appears, the slightest
> move of the mouse changes the selection (all buttons released) - and
> calls again the macro !
> I don't know how to avoid this. I feel there is a design problem here.
> The selection should not change when no mouse button is pressed.
> Tested on RC9 with Windows XP.
>
> Example of macro:
>
> Sub handleEvent(zone As Object)
> MsgBox("Hey!")
> End Sub
The message box interferes with cell selection, because the view doesn't
get a "button released" event. Change your macro to something that
doesn't show a message box, and it should work better.
Niklas