- Dim myRef
- Set MyRef = CreateObject("Component.InsideCOM")
- MsgBox "Sum(5, 3) = " & myRef.Sum(5, 3)
- ' Create a new method on the object.
- myRef.CreateNewSum "Hurray"
- ' Execute the method added at run time.
- ' Calls IDispatchEx::GetDispID followed by
- ' IDispatchEx::InvokeEx.
- MsgBox "Hurray(2, 8) = " & myRef.Hurray(2, 8)