View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default disabling a command button

Forms toolbar controls have very little flexibility. I don't believe what
you want can be done. You can programmatically change the font color to
gray, but I think you're out of luck with the hand-shaped cursor.

--

Vasant



"Paul James" wrote in message
...
I'm sorry, Tom, I didn't mean to cause you to have to resend your

solution.
I had written a reply to your first message saying that your solution

worked
fine, but for some reason that message hasn't shown up on the newsgroup.

I have experimented with the code you sent me:

worksheets("sheetName").Buttons("cmdName").enabled = false


and it does indeed disable the command button. However, it doesn't gray

out
the button, or provide any other visual cue that the button is not active.
Moreover, the cursor still changes to the white hand when it moves over

the
button, implying that the button is active, even though it isn't.

I'd prefer not to set the visible property to false so you can't see it,

and
the ideal would be to have a command that will gray out the text on the
button when it's disabled. Do you know of any way to do this?