J
John Krueger
Does anybody know how to create controls during run-time
on a userform in Excel VBA? I actually saw a post on how
to do this once but I can't find it anymore. At the time
I thought, "I'll never need to do that..."
Anyway, I'm trying to use Controls.Add, but I can't figure
out what the first argument (bstrProgID as String) is
supposed to be. I'm assuming that is where I declare the
control type (checkbox, label etc) but I can't figure out
the syntax.
Controls.Add(bstrProgID as String, [Name] , [Visible])
Things I've tried:
Controls.Add("vb.label", "lblLabel1" , True)
Controls.Add("MSForms.CommandButton.1", "cmdButton1" ,
True)
John
on a userform in Excel VBA? I actually saw a post on how
to do this once but I can't find it anymore. At the time
I thought, "I'll never need to do that..."
Anyway, I'm trying to use Controls.Add, but I can't figure
out what the first argument (bstrProgID as String) is
supposed to be. I'm assuming that is where I declare the
control type (checkbox, label etc) but I can't figure out
the syntax.
Controls.Add(bstrProgID as String, [Name] , [Visible])
Things I've tried:
Controls.Add("vb.label", "lblLabel1" , True)
Controls.Add("MSForms.CommandButton.1", "cmdButton1" ,
True)
John