How to specify the code module as the "Object Link" parameter in VB.Net CallByName?

I am trying to call a public subroutine from a Windows form based on a string variable containing the name of the subroutine. A subroutine is a procedure in a code module and works great when called using the procedure name directly.

The CallByName VB.net function should work, but I don’t know how to specify the module name as an Object Ref parameter.

enter image description here

In the code shown, "ReportLibrary" is a module containing a public node with the name contained in the strReportProcedure line. As a result, the following error helper appears:

enter image description here

Help reports this ObjectRef parameter:

ObjectRef
Type: System.Object
Required. An object. A pointer to an object that displays a property or method.

CallByName?

+3
3

CallByName VB.Net, . , , CallByName .

+1

, , . , ​​:

Dim RL as NEW Reportlibrary

, :

CallByName(RL, strReportProcedure , CallType.Method , blnPreview)

, , ( ) . " ".
!

+1

Dim object As NEW Reportlibrary, .

0

All Articles