-
Formulario en tiempo de diseño
Hola a todos:
Estoy trabajando en la creación de formularios en tiempo de diseño con VBA.
El siguiente código lo realiza
[VBA]Sub Test()
Dim Frm As Object
Dim Frame As MSForms.Frame
Dim OptionB As MSForms.OptionButton
Set Frm = ThisWorkbook.VBProject.VBComponents.Add(3)
Set Frame = Frm.designer.Controls.Add("Forms.frame.1")
With Frame
.Name = "Frame1"
.Caption = "Frame1"
.Top = 5
.Left = 5
.Width = 75
.Height = 40
End With
Set OptionB = Frm.designer.Controls.Add("Forms.optionbutton.1")
With OptionB
.Name = "OButton1"
.Caption = "Female"
.Top = 15
.Left = 80
.Width = 60
.Height = 16
End With
Set OptionB = Frm.designer.Controls.Add("Forms.optionbutton.1")
With OptionB
.Name = "OButton2"
.Caption = "Male"
.Top = 15
.Left = 140
.Width = 60
.Height = 16
End With
VBA.UserForms.Add(Frm.Name).Show
ThisWorkbook.VBProject.VBComponents.Remove Frm
End Sub
[/VBA]
Mi problema consiste en que no se como insertar los optionbutton en el frame.
Agradecería alguna orientación.
Gracias de antemano.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules