Hi,
I would like to change the property Enable of a command button (button1) during the execution of a macro from another command button (button2).
I mean, I need that button2 calls a macro to enable/disable button1.
I saw the example about how to change the enable property of the button who calls the macro http://user.services.openoffice.org/en/ ... nt#p118966 but I think my question is quite different.
Thanks!
[Solved] Enable/Disable a button from another button in Calc
[Solved] Enable/Disable a button from another button in Calc
Last edited by aborbon on Thu Sep 23, 2010 5:43 am, edited 1 time in total.
OpenOffice 3.2.0
Ubuntu 10.04 LTS Lucid Lynx
Ubuntu 10.04 LTS Lucid Lynx
- Charlie Young
- Volunteer
- Posts: 1559
- Joined: Fri May 14, 2010 1:07 am
Re: Enable/Disable a button from another button in Calc
See attached.
Edit: I guess I have Button 2 and Button 1 backwards, but that shouldn't be a big deal |
- Attachments
-
- DisableButton.ods
- Enable/Disable Button
- (10.32 KiB) Downloaded 834 times
Apache OpenOffice 4.1.1
Windows XP
Windows XP
Re: Enable/Disable a button from another button in Calc
Thank you!!! That was really fast and helpfull!
Well, I also found another solution in the spanish version of the forum http://user.services.openoffice.org/es/ ... B3n#p12072, here it is:
It only has a problem, both buttons have to be in the same form. But no problem for me, in my case they are!


Well, I also found another solution in the spanish version of the forum http://user.services.openoffice.org/es/ ... B3n#p12072, here it is:
Code: Select all
Sub subButtonDisableButton2(Event As Object)
Dim oForm As Object
Dim oModelButton As Object
oForm=Event.Source.Model.Parent 'We get the model of the form from the button who calls the macro
oModelButton=oForm.GetByName("button2") 'Now we get the model of button2
oModelButton.Enabled=False 'And we disable it!
End Sub


OpenOffice 3.2.0
Ubuntu 10.04 LTS Lucid Lynx
Ubuntu 10.04 LTS Lucid Lynx