I have created an OpenOffice Calc spreadsheet and I have inserted a button into it. I can successfully call a macro with the button. I want to have a cursor hand when I mouse-over the button.
First, I switched to 'Design' mode, then I right-clicked on my button, and using the pop-up menu which appears, I selected the 'Events' tab. Then I clicked on the 'Mouse inside' dot dot dot button. In the 'Assign action' window that popped up, I clicked on the 'Macro..' button. I then got the 'Macro Selector' pop-up window, where I choose the 'OpenOffice Macros' folder in the left side pane. I expanded 'Tools'>'ModuleControls' from that 'Library' pane and then selected 'SwitchMousePointer' from the right side 'Macro name' pane, then clicked the 'Ok' 'Ok' buttons.
But now when I hover the mouse cursor over my button I get an OpenOffice Error window popping up "A Scripting Framework error occurred while running the Basic script Tools.ModuleControls.SwitchMousePointer."
I've very little OO experience but I have not found what I want here or on the OO Forum site. I would be very grateful to get some help, thanks, Nige.
The SwitchMousePointer needs attributes (oWindowPeer as Object, bDoEnable as Boolean). So you can't simply assign it to a event. And it will not do what you think.
You should better write you own Sub to change the Pointer. Also there is no need to do this on every mouse event. It should be done once on sheet activate for example.
For a introduce in OpenOffice.org BASIC Programming see https://wiki.openoffice.org/wiki/Documentation/BASIC_Guide. And you will need a debugging tool, if you want to program your own BASIC macros. Therefore see especially: https://wiki.openoffice.org/wiki/Documentation/BASIC_Guide/UNO_Tools
Assuming on the sheet is a button named "Push Button 1" then:
And assign this to the sheet event Activate Document. Right click the sheet tab and select Sheet Events from the context menu. Then:
If, and only if, the button is on Sheets(0) then the sheet event Activate Document not occurs while opening the document and this sheet is in front. In this case we have to call the Sub ChangeMousePointer also on document event Open Document.
To assign the macro to the document event Open Document select Tools - Customize from the menu and: