Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Microsoft tells me how I can add a checkbox to a MultiPage[^]
VB
Dim MyTextBox As Control 
 
Private Sub CommandButton1_Click() 
Set MyTextBox = MultiPage1.Pages(0).Controls.Add("MSForms" _ 
 & ".TextBox.1", "MyTextBox", Visible) 
End Sub 


So I modified the code
VB
Set myTextBox = MultiPage1.Pages(zaehler).Controls.Add("MSForms" & ".TextBox.1", "TextBox" & zaehler, Visible)

If I run the makro now, it shows me a runtime error: invalid class name
Where is my fault? I can't find it :(
Posted
Updated 16-Jul-15 0:55am
v4

1 solution

fyi

I don't kow why, but the following code is working instead those of MS:
VB
Set myTextBox = MultiPage1.Pages(zaehler).Controls.Add("Forms.TextBox.1", "TextBox" & zaehler, Visible)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900