PDA

View Full Version : [SOLVED] Making an ActiveX control button inactive?



infinity
07-20-2005, 08:59 PM
Hi all,

This is probably a really simple thing to do and I know it is possible because I see it all the time with the "APPLY" button in Windows. I need to be able to select an ActiveX button and make it inactive in the process of running a macro.:dunno Thanx in advance for your help.

Scott

Jacob Hilderbrand
07-20-2005, 09:20 PM
Try this.



CommandButton1.Enabled = False

infinity
07-21-2005, 11:01 PM
Thank you Jake, I tried this;


ActiveSheet.Shapes("Button 11").Select
CommandButton1.Enabled = False

That returns an error that reads " Run time error '424' object required"
What does that mean and how do I make it work properly?

Thanx for your help

Scott

Jacob Hilderbrand
07-23-2005, 09:27 PM
The error means that the object that you referenced (in this case CommandButton1) does not exists.

You need to use the ActiveX Command Button control instead of the Forms Button.

You can get the Command Button control from the Control Toolbox on the Visual Basic toolbar.

When you use this line:



CommandButton1.Enabled = False


CommandButton1 must be the name of the control. Change as needed.

Bob Phillips
07-24-2005, 05:55 AM
ActiveSheet.Shapes("Button 11").Select
CommandButton1.Enabled = False

That returns an error that reads " Run time error '424' object required"
What does that mean and how do I make it work properly?


With ActiveSheet.Buttons("Button 11")
.Enabled = False
End With

infinity
07-24-2005, 03:04 PM
Did I mention you all are awesome? :clap:




With ActiveSheet.Buttons("Button 11")
.Enabled = False
End With



Thank you this worked exactly the way I wanted it to. Thanx again

Scott