Invoking Methods at Runtime?
Hi,
I need to be able to create and call a method of a COM component dynamically at runtime.
E.g...
If a user enters the string "Cpn1" as the name of a component, "Cls1" as the name of a class within that component and "Mth1" as a method of that class, how can I create and invoke the method at runtime.
If I knew the requirements at design time I could write the following...
Dim objCls1 as Cpn1.Cls1
set objCls1 = New Cpn1.Cls1
objCls1.Mth1
set objCls1 = Nothing
At runtime however, while I can declare the object "As Object" and create it using 'CreateObject("Cpn1.Cls1")', I haven't a clue as to how to invoke the "Mth1" method.
Can it be done?
:confused: