HelgeLarsen
Programmer
I would like to declare a variable representing a userform. If I simply declare it as OBJECT, things function.
But if I declare it as USERFORM, I get an error when showing the userform.
Run-time error '438': "Object doesn't support this property or method".
Do I really have to declare it as a general OBJECT ?
I have enclosed some VBA to show my problem.
Kindly,
Helge
______________________________
Sub Test0()
Load UserForm1
UserForm1.Show ' No variable : OK
End Sub
Sub Test1()
Dim myUF As Object
Set myUF = UserForm1
Load myUF
myUF.Show ' Object : OK
End Sub
Sub Test2()
Dim myUF As UserForm
Set myUF = UserForm1
Load myUF
myUF.Show ' UserForm : Error 438
End Sub
Sub Test3()
Dim myUF As MSForms.UserForm
Set myUF = UserForm1
Load myUF
myUF.Show ' MSForms.UserForm : Error 438
End Sub
But if I declare it as USERFORM, I get an error when showing the userform.
Run-time error '438': "Object doesn't support this property or method".
Do I really have to declare it as a general OBJECT ?
I have enclosed some VBA to show my problem.
Kindly,
Helge
______________________________
Sub Test0()
Load UserForm1
UserForm1.Show ' No variable : OK
End Sub
Sub Test1()
Dim myUF As Object
Set myUF = UserForm1
Load myUF
myUF.Show ' Object : OK
End Sub
Sub Test2()
Dim myUF As UserForm
Set myUF = UserForm1
Load myUF
myUF.Show ' UserForm : Error 438
End Sub
Sub Test3()
Dim myUF As MSForms.UserForm
Set myUF = UserForm1
Load myUF
myUF.Show ' MSForms.UserForm : Error 438
End Sub