I am cross posting ( i think ) because the server seems to have an issue
with the other newsgroup (possibly)
Hello everyone I hope someone can help me here.
I have a problem at work with my ID resetting and my menu bar (my custom
menu bar) has the menus but none of my buttons or the menu lists stay with
the ID change...
This is something that is too small a problem for our IT people to work out
so I did a fix for it. I have a script itself run and add the macros to the
menu lists. It works with the following...
Dim CmdBar As CommandBar
Dim CmdBarMenu As CommandBarControl
Dim CmdBarMenuItem As CommandBarControl
Set CmdBar = Application.CommandBars(quot;My Custom Menu Barquot;)
Set CmdBarMenu = CmdBar.Controls(quot;Softwarequot;)
Set CmdBarMenuItem = CmdBarMenu.Controls.Add
With CmdBarMenuItem
.Caption = quot;5-Digit Zip Code Formatquot;
.OnAction = quot;'quot; amp; ThisWorkbook.Name amp; quot;'!C200010quot;
.Tag = quot;SomeStringquot;
End WithThis is repeated for each menu I have manually typed in the bar, quot;Softwarequot;
being one of them.
So I'm able to add the menu lists to menus I've entered as the one mentioned
above, however I don't know how to add Buttons to my menu bar and keep the
assigned macro linked to the command (string?).
Can anyone assist with this? I need something like the above script but it
needs to add the macro to the button. I would imagine its a bit different
because you need to identify the button image but man would it help if
someone out there could assist.
Thank you ahead of time.
G
Hi Greegan
See this pages for examples
support.microsoft.com/default...02amp;Product=xlw
How to customize menus and menu bars in Excel
www.j-walk.com/ss/excel/tips/tip53.htm
Creating Custom Menus (John Walkenbach) TIP
www.erlandsendata.no/english/...oadcommandbars
Ole P. Erlandsen's Web Site (Example workbooks)
--
Regards Ron de Bruin
www.rondebruin.nlquot;Greeganquot; gt; wrote in message ...
gt;I am cross posting ( i think ) because the server seems to have an issue
gt; with the other newsgroup (possibly)
gt;
gt; Hello everyone I hope someone can help me here.
gt;
gt; I have a problem at work with my ID resetting and my menu bar (my custom
gt; menu bar) has the menus but none of my buttons or the menu lists stay with
gt; the ID change...
gt;
gt; This is something that is too small a problem for our IT people to work out
gt; so I did a fix for it. I have a script itself run and add the macros to the
gt; menu lists. It works with the following...
gt;
gt; Dim CmdBar As CommandBar
gt; Dim CmdBarMenu As CommandBarControl
gt; Dim CmdBarMenuItem As CommandBarControl
gt; Set CmdBar = Application.CommandBars(quot;My Custom Menu Barquot;)
gt; Set CmdBarMenu = CmdBar.Controls(quot;Softwarequot;)
gt; Set CmdBarMenuItem = CmdBarMenu.Controls.Add
gt; With CmdBarMenuItem
gt; .Caption = quot;5-Digit Zip Code Formatquot;
gt; .OnAction = quot;'quot; amp; ThisWorkbook.Name amp; quot;'!C200010quot;
gt; .Tag = quot;SomeStringquot;
gt; End With
gt;
gt;
gt; This is repeated for each menu I have manually typed in the bar, quot;Softwarequot;
gt; being one of them.
gt;
gt; So I'm able to add the menu lists to menus I've entered as the one mentioned
gt; above, however I don't know how to add Buttons to my menu bar and keep the
gt; assigned macro linked to the command (string?).
gt;
gt; Can anyone assist with this? I need something like the above script but it
gt; needs to add the macro to the button. I would imagine its a bit different
gt; because you need to identify the button image but man would it help if
gt; someone out there could assist.
gt;
gt; Thank you ahead of time.
gt;
gt; G
gt;
gt;
gt;
gt;
gt;
gt;
- Jul 25 Fri 2008 20:45
Adding buttons to a new menu bar
close
全站熱搜
留言列表
發表留言