Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default adding command button to menu

Sub AddMacro()

Set bar = CommandBars("Standard")
Set ctl = bar.Controls _
.Add(Type:=msoControlButton)

ctl.Caption = "Run my macro"
ctl.Style = msoButtonCaption

'Macro to run
ctl.OnAction = "MyMacro"

End Sub

--
urkec


"excel-tr" wrote:

Hi,

how can I add a command button to standart excel toolbar.When I click it a
macro will work.

regards.
--
SAHRAYICEDIT-ISTANBUL

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
Placing a Command Button in a New Tool Menu Office Junior[_2_] Excel Discussion (Misc queries) 2 May 12th 07 04:50 PM
Command Button Created from Forms Menu Question JR_06062005[_2_] Excel Programming 2 August 18th 06 06:00 PM
Using code from custom menu bar to a Command button Alex Martinez Excel Programming 0 September 27th 05 06:33 AM
Command/option/spin button - no control menu available Daniel[_7_] Excel Programming 3 March 5th 04 03:02 PM
Adding toolbar/menu command to Excel using C# Aaron Queenan Excel Programming 0 October 29th 03 07:32 PM


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