Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default msoControlButton to "Worksheet Menu Bar" ?

Hi All,

I find it easy to add an msoControlPopup menu item to "Worksheet Menu
Bar"

Is it possible to add msoControlButton to "Worksheet Menu Bar" ?

when I tried to get it does,nt work !?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default msoControlButton to "Worksheet Menu Bar" ?

Hi Soniya

Do you want this

Sub MenuBar_Item()
MenuBar_Item_Delete
With Application.CommandBars(1)
With .Controls.Add(Type:=msoControlButton, befo=1)
.Style = msoButtonCaption
.Caption = "&Hi"
.OnAction = ThisWorkbook.Name & "!TestMacro"
End With
End With
End Sub

Sub MenuBar_Item_Delete()
On Error Resume Next
Application.CommandBars(1).Controls("Hi").Delete
On Error GoTo 0
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Soniya" wrote in message ups.com...
Hi All,

I find it easy to add an msoControlPopup menu item to "Worksheet Menu
Bar"

Is it possible to add msoControlButton to "Worksheet Menu Bar" ?

when I tried to get it does,nt work !?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default msoControlButton to "Worksheet Menu Bar" ?

Soniya,

This worked for me

With Application.CommandBars("Worksheet Menu Bar")
With .Controls.Add(Type:=msoControlButton, temporary:=True)
.Caption = "Test"
.Style = msoButtonCaption
.OnAction = "myMacro"
End With
End With


Note setting the style, this is critical if you want to see the text <G

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Soniya" wrote in message
ups.com...
Hi All,

I find it easy to add an msoControlPopup menu item to "Worksheet Menu
Bar"

Is it possible to add msoControlButton to "Worksheet Menu Bar" ?

when I tried to get it does,nt work !?

Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default msoControlButton to "Worksheet Menu Bar" ?

thanks for your help.

Now it works !

i was missing the .style part

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
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F daves Excel Discussion (Misc queries) 3 April 24th 07 04:52 AM
Stop users from accessing "Protection" option from "Tools" menu I Believe Excel Programming 2 December 19th 05 02:44 PM
CommandBars("Worksheet Menu Bar").Controls("Tools").Enabled = Fals Arturo Excel Programming 3 May 26th 05 05:44 PM
save and restore "Workbook Menu Bar" & "Cell" menus Jeff Higgins Excel Programming 2 February 14th 05 01:33 AM
Make "Worksheet Menu Bar" invisible or Delete/hide it's buttons Bob Phillips[_5_] Excel Programming 0 August 11th 03 01:05 PM


All times are GMT +1. The time now is 11:40 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"