VBA object added in a form
Hi to all,
I've added a commandbutton to a form during its execution, but i'm not able to assign an execution code to it! i've tryed the help on line and haven't found anything usefull, may you help me?
This is the code i wrote:
Dim CButton As Control
Set CButton = frmDiametri_e_Spessori.Controls.Add("Forms.CommandButton.1")
CButton.Left = X
CButton.Top = Y
CButton.Caption = "OK"
Now i want to add some code to the CButton control
Thanks
Pierpaolo
thanks for the reply...
i've also noticed that this isn't the right forum and i've reposted the question in the VBA forum, anyway:
I've a macro in excel that ask the user for some inputs. i store these input in an array. The number of inputs may vary.
After i initialize the main form, in which i've putted a commandbutton to call another form to show me these inputs by using some textbox. So i've tryied to
make a form that have the right number of textbox. i've done this and put in the new form a button. But when i want to click the button to close the form i've
noticed that i'm uanble to associate any routine to the button!
I hope to have been clearly
I'll apreciate any answer
Thanks
Pierpaolo