[VBA]Sub make_userform1()
Dim TempForm
Dim NewTextBox As MSForms.TextBox
Dim NewLabel As MSForms.Label
Dim NewCommandButton1 As MSForms.CommandButton
Dim NewCommandButton2 As MSForms.CommandButton
Dim x As Integer
' Hide VBE window to prevent screen flashing
Application.VBE.MainWindow.Visible = False
' Create a Temp UserForm
Set TempForm = ThisWorkbook.VBProject.VBComponents.Add(3)
' Add a Label
Set NewLabel = TempForm.Designer.Controls.Add("forms.label.1")
With NewLabel
.Width = 140
.Height = 20
.Left = 48
.Top = 10
.Caption = "Lotus Notes Password"
End With
' Add a TextBox
Set NewTextBox = TempForm.Designer.Controls.Add("forms.textbox.1")
With NewTextBox
.PasswordChar = "*"
.Width = 140
.Height = 20
.Left = 48
.Top = 30
End With
' Add the OK button
Set NewCommandButton1 = TempForm.Designer.Controls.Add("forms.CommandButton.1")
With NewCommandButton1
.Caption = "OK"
.Height = 18
.Width = 66
.Left = 126
.Top = 80
End With
' Add the Cancel button
Set NewCommandButton2 = TempForm.Designer.Controls.Add("forms.CommandButton.1")
With NewCommandButton2
.Caption = "Cancel"
.Height = 18
.Width = 66
.Left = 30
.Top = 80
End With
End Sub
[/VBA]
getting compile error user type not defined on
[VBA]Dim NewTextBox As MSForms.TextBox[/VBA]