have simple user form in Excel on which I have frame control. At runtime I add radio buttons to the frame. When the form appears the frame is empty. If move the frame the radio buttons appear. Why is the frame hiding the radio buttons? If I delete the frame and then re-add it, the first time I execute the code the buttons appear inside the frame. All subsequent executions and the buttons are hidden again. Any ideas here would be much appreciated.
VBA Code:
Private Sub AddProductLine()
Dim optBtn As control
Dim thisFrame As Frame
Dim c As control
For Each c In Product_Configurator.Controls
If TypeOf c Is msforms.Frame Then
Set thisFrame = c
Exit For
End If
Next c
Set optBtn = Me.Controls.Add("Forms.OptionButton.1", "GMP", True)
With optBtn
.Caption = "GMP"
.Width = 40
.Top = 50
.Left = 22
.GroupName = "ProductLine"
End With
End Sub