Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
With Application.CommandBars("Standard") .Controls(ID:=2950) .OnAction = "myMacro" End With Regards, Rob Richard wrote: Hello, I'm trying to assgin a macro on existing menu (that I added previousely) in command bar as below, but I 'm getting a error. By the way, ID:2950 is the Smiley face icon. Can anyone help me to fix it, please? Error msg is "name or argument not found" With Application.CommandBars("Standard").Controls(ID:=2 950) .OnAction = "myMacro" End With |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I got carried away... Reference your button's index, not it's
ID. Example, If I have one button on the menu bar, it's index is 1. If I have 3 buttons, then the index is it's position on the bar counting from the left. With Application.CommandBars("Standard").Controls(Your Button index) .OnAction = "ThisWorkbook.myMacro" End With OKROB wrote: Try this: With Application.CommandBars("Standard") .Controls(ID:=2950) .OnAction = "myMacro" End With Regards, Rob Richard wrote: Hello, I'm trying to assgin a macro on existing menu (that I added previousely) in command bar as below, but I 'm getting a error. By the way, ID:2950 is the Smiley face icon. Can anyone help me to fix it, please? Error msg is "name or argument not found" With Application.CommandBars("Standard").Controls(ID:=2 950) .OnAction = "myMacro" End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"=ROW()-1" type of coding doesn't appear in a filter / is there coding that does? | Excel Programming | |||
Implant macro coding into ASP coding | Excel Programming | |||
Need help with check box coding, urgent!!! | Excel Programming | |||
Need help with check box coding, urgent!!! | Excel Programming | |||
Coding to check for a sheet name and add it if it's not there | Excel Programming |