Article ID: 129801
Article Last Modified on 7/1/2004
Sub Main ()
Public MyString As String
Public Function MyFunction() As String
MyFunction = "You never know what you're gonna get."
End Function
Public Sub Class_Initialize()
MyString = "Life is like a box of chocolates."
End Sub
Property Value ------------------------------------ Instancing 2 - Creatable MultiUse Public True
' In the General Declarations section:
Private MyObj As Object
Private Sub Form_Load ()
Set MyObj = CreateObject("Project1.Class1")
End Sub
Private Sub Form_Click()
Print MyObj.MyString
Print MyObj.MyFunction
End Sub
Private Sub Form_Unload (Cancel As Integer)
Set MyObj = Nothing
End Sub
Keywords: kbhowto KB129801