Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating Toolbars
Hello,
Through VBA coding how can a new Toolbar automatically be creating & also automatically have a certain Macro to run linked to it ? I playing around with the CommandBars Object but couldnt figure it out. So for example to have a new ToolBar called "RemoveData" & have a XLA Macro called "RemoveData" linked to it ? Also so that the toolbar shows in the Top section of the screen where the rest of the toolbars are. Any help would be greatly appreciated. Thank you, Jeff |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating Toolbars
Something along these lines will create a menu for you:-
Set myMenuBar = CommandBars.ActiveMenuBar Set newMenu = myMenuBar.Controls.Add(Type:=msoControlPopup, _ befo=8, Temporary:=True) newMenu.Caption = "New Menu" Set MenuItem = newMenu.Controls _ .Add(Type:=msoControlButton, ID:=1) With MenuItem .Caption = "Remove Data" .FaceId = 110 .TooltipText = "Data Removal" .OnAction = "removeData" End With Then, you can remove it when shutting down by using:- Application.CommandBars("Worksheet Menu Bar").Controls("New Menu").Delete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Toolbars | Excel Discussion (Misc queries) | |||
Creating toolbars thru VBA | Excel Discussion (Misc queries) | |||
Please Help, No Toolbars in my view-toolbars! | Excel Programming | |||
Creating Custom Toolbars | Excel Programming | |||
Creating/Destroying Toolbars Programmatically | Excel Programming |