Hi all,
I'm trying to programmatically create a page and a textbox within a Multipage control and I am receiving the following error - "Run-time error '13': Type mismatch
The code is as follows:
Private Sub btnReset_Click()
Dim pagNew As Page
Set pagNew = MultiPage1.Pages.Add("pagNewPage", "NewPage")
Dim cntrl As Control
Set cntrl = pagNew.Controls.Add("Forms.TextBox.1", "txtNewTextBox", True)
cntrl.Left = 10
cntrl.Top = 10
End Sub
There is a single Multipage control on the userform called MultiPage1.
The above code is in the codebehind file of the userform and all code is within the one VBAproject workbook. Any guidance would be much appreciated. Thanks in advance.
I'm trying to programmatically create a page and a textbox within a Multipage control and I am receiving the following error - "Run-time error '13': Type mismatch
The code is as follows:
Private Sub btnReset_Click()
Dim pagNew As Page
Set pagNew = MultiPage1.Pages.Add("pagNewPage", "NewPage")
Dim cntrl As Control
Set cntrl = pagNew.Controls.Add("Forms.TextBox.1", "txtNewTextBox", True)
cntrl.Left = 10
cntrl.Top = 10
End Sub
There is a single Multipage control on the userform called MultiPage1.
The above code is in the codebehind file of the userform and all code is within the one VBAproject workbook. Any guidance would be much appreciated. Thanks in advance.