Quote Originally Posted by chocobochick
I might be mistaken, but I don't think you can procedures that take a parameter can be assigned to buttons on command bars. These buttons can only trigger macros, and only a Sub procedure with no parameters qualifies as a valid macro.
I haven't tried assigning procedures with non-optional arguments to buttons on command bars, but I usually create a dummy optional argument in Word and Excel to hide the procedures designed for command bar buttons from users who hit ALT+F8. Buttons on command bars work just fine with these procedures, but if you want to use parameters, you can't use them as arguments. Instead, you have to store the values in the parameter and/or tag property of the button. I mention the tag property here, because the maximum length of a string in the parameter property is 255, so it's often necessary to spill over into the tag property when your parameters contain long strings.