Hi PaultheGreat,
I have never found the exact reason of that when you assign a macro by using parameter. But I suggest another method which would let you to find the clicked button and execute a related command in your code instead using a parameter.
Just set the Tag properties of the Command Buttons that you are probably creating by code to 1,2,3 or however you like then use the code below instead.
Sub MyCode()
Select Case Application.CommandBars.Ac
Case "1"
MsgBox "1"
Case "2"
MsgBox "2"
Case "3"
MsgBox "3"
End Select
End Sub
I hope this helps.
Suat
Main Topics
Browse All Topics





by: jsemenakPosted on 2003-07-02 at 23:24:28ID: 8846648
Is macro activate with this same n parameter.
If you click on button having related macro it will be activated only one time.
Try check n parameter in double activation.
Maybe problem is that you have for example toolbar, click on which start macro
and second times macro is activated because click on button on toolbar. But it is only just
immediete idea.