to truly add a control at runtime in VBA you need to execute the Add method of the UserForm object's Controls property. This method expects the ProgID of the control you want to add - something like the following code should be added to your test UserForm:
Code:
Option Explicit
Private WithEvents mRuntimeButton As MSForms.CommandButton
Private Sub mRuntimeButton_Click()
MsgBox "runtime button clicked"
End Sub
Private Sub UserForm_Initialize()
Set mRuntimeButton = Me.Controls.Add("Forms.CommandButton.1", "mRuntimeButton", True)
End Sub
You'll additionally need to set a whole bunch of properties (Height, Width, Caption, etc) in order to get the button looking as you want it
If you need to know more, highlight the Add method in your VBA environment and hit F1 for some help