Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How to preserve the customized menues from one PC to another?
Emiliano |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Build them dynamically
Here is an example Private Sub Workbook_Open() Dim oCb As CommandBar Dim oCtl As CommandBarPopup Dim oCtlBtn As CommandBarButton Set oCb = Application.CommandBars("Worksheet Menu Bar") With oCb Set oCtl = .Controls("Tools").Controls.Add( _ Type:=msoControlPopup, _ temporary:=True) oCtl.Caption = "myButton" With oCtl Set oCtlBtn = .Controls.Add( _ Type:=msoControlButton, _ temporary:=True) oCtlBtn.Caption = "myMacroButton" oCtlBtn.FaceId = 161 oCtlBtn.OnAction = "myMacro" End With With oCtl Set oCtlBtn = .Controls.Add( _ Type:=msoControlButton, _ temporary:=True) oCtlBtn.Caption = "myMacroButton2" oCtlBtn.FaceId = 161 oCtlBtn.OnAction = "myMacro2" End With 'etc. End With End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim oCb As CommandBar Set oCb = Application.CommandBars("Worksheet Menu Bar") oCb.Controls("Tools").Controls("myButton").Delete End Sub To add this, go to the VB IDE (ALT-F11 from Excel), and in the explorer pane, select your workbook. Then select the ThisWorkbook object (it's in Microsoft Excel Objects which might need expanding). Double-click the ThisWorkbook and a code window will open up. Copy this code into there, changing the caption and action to suit. This is part of the workbook, and will only exist with the workbook, but will be available to anyone who opens the workbook. -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "eggpap" wrote in message ... How to preserve the customized menues from one PC to another? Emiliano |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I restore my office 2003 menues look & feel? | Excel Discussion (Misc queries) | |||
Is there an Excel Viewer ONLY = Excel WITHOUT menues+toolbars around ? | Excel Programming | |||
Is there an Excel Viewer ONLY = Excel WITHOUT menues+toolbars around ? | Excel Discussion (Misc queries) | |||
Partitions in Short Cut menues | Excel Programming | |||
how do I add Drop down menues in Excel? | Excel Worksheet Functions |