Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Empty custom toolbar
Hello
I created an excel template file haveing some macro functions. Then created a custom toolbar and assign macroes to the buttons. Now when I copy the template to any other machine and open the template , the empty toolbar is displyed. the macro code still exist but buttons are not displayed. Regards Ashish |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Empty custom toolbar
I suggest that the file creates its own tool bar usibng
the auto_open or workbook_open event, and removes th ebar with the close events. that way the app controls the bar. here's some example code that I sent in an earlier mail. place in a standard modle. call the AddMenu proc from the open event and call the killmenu proc from the colse event. Sub AddMenu() Dim ctrlMain As CommandBarPopup Dim ctrlItem As CommandBarControl Dim ctrlSubItem As CommandBarButton KillMenu Set ctrlMain = CommandBars("Worksheet Menu Bar").Controls.Add _ (Type:=msoControlPopup, _ temporary:=True) With ctrlMain .Caption = "&Analysis" Set ctrlItem = .Controls.Add (Type:=msoControlButton) With ctrlItem .Caption = "&Initialse Test" .OnAction = "subInitialise" End With Set ctrlItem = .Controls.Add (Type:=msoControlPopup) With ctrlItem .Caption = "&Explore Test" .BeginGroup = True Set ctrlSubItem = .Controls.Add (Type:=msoControlButton) With ctrlSubItem .Caption = "Type &1" .OnAction = "sub1" End With Set ctrlSubItem = .Controls.Add (Type:=msoControlButton) With ctrlSubItem .Caption = "Type &2" .OnAction = "Sub2" End With End With Set ctrlItem = .Controls.Add (Type:=msoControlButton) With ctrlItem .Caption = "&Plan Test" .BeginGroup = True .OnAction = "sub3" End With End With End Sub Sub KillMenu() Dim cmdbar As CommandBar On Error Resume Next Set cmdbar = CommandBars("Worksheet Menu Bar") cmdbar.Controls("&Analysis").Delete On Error GoTo 0 End Sub Patrick Molloy Microsoft Excel MVP -----Original Message----- Hello I created an excel template file haveing some macro functions. Then created a custom toolbar and assign macroes to the buttons. Now when I copy the template to any other machine and open the template , the empty toolbar is displyed. the macro code still exist but buttons are not displayed. Regards Ashish . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA custom toolbar | Excel Discussion (Misc queries) | |||
Custom Toolbar | Excel Discussion (Misc queries) | |||
Custom Toolbar | Excel Discussion (Misc queries) | |||
Empty custom toolbar | Excel Programming | |||
saving toolbar buttons on custom toolbar | Excel Programming |