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?
			
			
													[Solved] Change properties of Calc Push Button using macro
							 [Solved] Change properties of Calc Push Button using macro
						[Solved] Change properties of Calc Push Button using macro
		
													
						
			
			
			
			
					Last edited by Nocton on Wed Dec 06, 2023 8:06 pm, edited 1 time in total.
									
			
						
							OpenOffice 4.1.12 on Windows 10
			
						Re: Change properties of Calc Push Button using macro
Here is a sample file with an embedded macro.
Modified sample: I just deleted two helper Print commands.
			
			
													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.
			
						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.
Re: Change properties of Calc Push Button using macro
Thank you Zizi64 - a nice solution.
			
			
									
						
							OpenOffice 4.1.12 on Windows 10
			
						Re: Change properties of Calc Push Button using macro
What is the code for "Additional information" ?
OpenOffice 4.1.15 on Windows 11
			
						Re: Change properties of Calc Push Button using macro
Code: Select all
msgbox oButton.TagLibreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (Bookworm) (on RaspberryPI5)
			
						Libreoffice 25.8… flatpak on Debian 13 (Bookworm) (on RaspberryPI5)
Re: [Solved] Change properties of Calc Push Button using macro
Use one of excellent object inspection tools: MRI and XrayTool
Usage of them - inside the macro code - will list all existing properties and methods (and others) of the programming objects:
			
			
									
						
							Usage of them - inside the macro code - will list all existing properties and methods (and others) of the programming objects:
Code: Select all
xray oButton
mri oButton
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.
			
						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.
Re: Change properties of Calc Push Button using macro
Thanks.
OpenOffice 4.1.15 on Windows 11
			
						
