View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default disabling a command button

Paul,

Use this

worksheets("sheetName").oleobjects("cmdName").obje ct.enabled=false


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Paul James" wrote in message
...
Is there any way to use VBA to disable or "gray-out" a command button in a
worksheet that was created from the Forms toolbar?

I tried using

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

but I get an "object doesn't support this property or method" example.

I know I can turn the visible property on and off, but I'd rather have it
grayed out when it's not available so it's presence is still displayed.

Is there a way to accomplish this?

Thanks in advance,

Paul