View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
OKROB OKROB is offline
external usenet poster
 
Posts: 14
Default Can you check the coding here please?

I ran the code and it works. Can you tell me if you are trying to edit
a button's function, or if you are adding a button to the "Standard"
toolbar. Perhaps that will clarify the issue.
Rob

Richard wrote:
OKROB,

I don't see any difference in your code from my code and I'm getting same
error.

Thanks

"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