[Solved] Change properties of Calc Push Button using macro

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

[Solved] Change properties of Calc Push Button using macro

Post by Nocton »

On sheet named 'Sheet1', I have a Push Button named 'Switch' with Label 'ON' and font colour green. After the button's action is executed I want to change it to 'OFF' and Red.
What is the best way to do that?
Last edited by Nocton on Wed Dec 06, 2023 8:06 pm, edited 1 time in total.
OpenOffice 4.1.12 on Windows 10
User avatar
Zizi64
Volunteer
Posts: 11476
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Change properties of Calc Push Button using macro

Post by Zizi64 »

Here is a sample file with an embedded macro.
ButtonProperties.ods
(10.14 KiB) Downloaded 524 times
Modified sample: I just deleted two helper Print commands.
Last edited by Zizi64 on Wed Dec 06, 2023 8:44 pm, edited 1 time in total.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Change properties of Calc Push Button using macro

Post by Nocton »

Thank you Zizi64 - a nice solution.
OpenOffice 4.1.12 on Windows 10
Post Reply