Hi
Here is code to revised your Sheet 1 Module Code
Please note the comments - you MUST change the property of
your Class1 (Use F4 key) from Private to PublicNotCreatable
as commented in the code below.
I have NOT fixed any of the other code errors.
EDIT-EDIT-EDIT
I forgot to state that for my ease - I created a new ActiveX button whose Name is
cmdValidateData and I put the code in that CLICK EVENT. You would put the code
in whatever Macro you are using to call the class.
HTH
John
Option Explicit
Private mo_MyClass As Class1
Public Property Get MyClass() As Class1
Set MyClass = mo_MyClass
End Property
Public Property Set MyClass(o As Class1)
Set mo_MyClass = o
End Property
Sub ShowUserform2()
UserForm2.Show
End Sub
Sub ShowUserform1()
UserForm1.Show
End Sub
Private Sub cmdValidateData_Click()
'On the properties window of Class1 (F4 Key)
'Change Instancing from 1 (Private) to 2 (PublicNotCreatable)
'Add the New Code above
'Add the Code below
'There are additional ERRORS in your code not related
'to the Class
Dim b As Boolean
Set MyClass = Nothing
Set MyClass = New Class1
b = MyClass.Validate
End Sub
Bookmarks