Article ID: 185731
Article Last Modified on 6/29/2004
Option Explicit
Public Function SquareIt(lngNumber As Long)
SquareIt = lngNumber ^ 2
End Function
'begin procedure
'create a object reference to the component
Dim obj As MyComponent.MyClass
Dim lngArgument As Long
Dim lngResult As Long
'create an instance of the object
Set obj = New MyClass
lngArgument = 2
'call the objects SquareIt method
lngResult = obj.SquareIt(lngArgument)
MsgBox "The Square of " & lngArgument & _
" is " & lngResult
'end procedureAdditional query words: createobject kbAutomation kbInterop kbDSupport kbDSD
Keywords: kbhowto KB185731