CallByName Instruction

Syntax:

CallByName(Obj,ProcName,CallType,[expr[, ...]])

Group: Flow Control

Description:
Call an Obj's method/property, ProcName, by name. Pass the exprs to the method/property.

Parameter Description

Obj Call the method/property for this object reference.

ProcName This string value is the name of the method/property to be called.

CallType Type of method/property call. See table below.

expr These expressions are passed to the obj's method/property.

CallType Value Effect

Example:

Sub Main
  On Error Resume Next
  CallByName Err, "Raise", vbMethod, 1
  Debug.Print CallByName(Err, "Number", vbGet) ' 1
End
Sub