Sean,
I haven't done this much but I think something like this - I assume a form
with a button on it. When you click the button another button is added:
Private Sub CommandButton1_Click()
Dim test_button As MSForms.CommandButton
Dim ctl As Control
'look under help for "Add" to get the other bstrProgIDs, but they follow the
form below
Set test_button = Me.Controls.Add(bstrProgID:="Forms.CommandButton.1",
Name:="btnTestButton", Visible:=True)
With test_button
.Caption = "Test Button"
End With
'It looks like you can only set location by recasting it as a generic
control
Set ctl = test_button
With ctl
.Top = 20
.Left = 20
End With
End Sub
John Walkenbach has a whole section on this here:
http://www.j-walk.com/ss/excel/tips/tip76.htm
hth,
Doug
"What-A-Tool" <(E-Mail Removed)> wrote in message
news:3e5Gh.32084$(E-Mail Removed)...
>I have code which creates a form if required - I am able to add standard
>form controls this way, but I would like to add an "additional" control
>(progress bar) to my programmatically created form. I can't seem to find
>any examples of how to do this.
> Could anyone help, please?
>
> Thank You - Sean
>