Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Command buttons

How do I apply code to disable command buttons. ie. If I want to
disable the 'Format Painter' button then what do I do??

Thanks in anticipation.

Rus Stevens
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Command buttons

This worked ok for me:

Application.CommandBars("standard").Controls("form at painter").Enabled = True

Russell Stevenson wrote:

How do I apply code to disable command buttons. ie. If I want to
disable the 'Format Painter' button then what do I do??

Thanks in anticipation.

Rus Stevens


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Command buttons

Dave,

Thanks for that. It worked a treat. I was almost there. Same storey
though, a minor error in the syntax.

One other problem I have is that I wish to disable the 'Insert Comment'
function on the drop down menu. Again, can you offer any advice.

Thanks
Rus



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Command buttons

One way:

Option Explicit
Sub testme()
On Error Resume Next
With Application.CommandBars("worksheet menu bar").Controls("Insert")
.Controls("comment").Enabled = False
.Controls("edit comment").Enabled = False
End With
On Error GoTo 0
End Sub

If the activecell already has a comment, then you see "edit comment". I just
turned both off (ignoring any error).



Russell Stevenson wrote:

Dave,

Thanks for that. It worked a treat. I was almost there. Same storey
though, a minor error in the syntax.

One other problem I have is that I wish to disable the 'Insert Comment'
function on the drop down menu. Again, can you offer any advice.

Thanks
Rus

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Buttons Wilco Excel Discussion (Misc queries) 0 January 13th 11 10:35 AM
Command Buttons Hoyas07 Excel Discussion (Misc queries) 2 February 11th 08 03:42 PM
Help with command buttons Danno Excel Worksheet Functions 1 October 7th 05 10:32 PM
command buttons Natalie Excel Worksheet Functions 1 March 7th 05 01:45 PM
Control Buttons vs. Command Buttons Robert Gibson Excel Programming 1 October 13th 03 04:33 PM


All times are GMT +1. The time now is 11:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"