Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable/dim form button object

Status
Not open for further replies.

Zac5

Programmer
Jan 30, 2003
75
US
I would like to disable a simple form object button I have in my worksheet, I would expect it to be something along the lines of

Worksheets("sheet 1").???.Enabled = False

Can someone put me in the right direction please

thanks,

Zac
 
Have you tried to play with the macrorecorder ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes I tried macrorecorder but it didn't help in this case.

thank you.
 
Hi
I don't think you can enable/disable a button created from the FORMS toolbar. For that you would need to create your button using the control toolbox button.

Though I stand to be corrected on this!

If using a forms button you can hide it altogether (but there may be other properties you could utilise) as follows

Worksheets(1).Shapes("button 1").Visible = False


For a command button you can set the enabled property to false:-

CommandButton1.Enabled = False

;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 
Loomah,

I didn't think so either. But you can using something like:
Code:
Worksheets(1).Shapes("Button 1").ControlFormat.Enabled=False
However, I don't like this approach because the button is not dimmed and the cursor still changes to a "hand" when the user mouses over the button; i.e. no visual clues that the button is disabled. As you point out, the Control Toolbox (ActiveX) button is the way to go here.


Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top