Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default 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
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
Toolbars Sarah at DaVita Excel Discussion (Misc queries) 1 January 23rd 08 02:43 AM
Creating toolbars thru VBA mike_mike Excel Discussion (Misc queries) 2 August 10th 05 09:02 AM
Please Help, No Toolbars in my view-toolbars! [email protected] Excel Programming 2 February 19th 05 09:15 PM
Creating Custom Toolbars excel_naive[_14_] Excel Programming 1 April 21st 04 03:35 PM
Creating/Destroying Toolbars Programmatically Syed Zeeshan Haider[_5_] Excel Programming 2 January 27th 04 05:32 AM


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