CallByName Instruction
Syntax
CallByName(Obj, ProcName, CallType, [expr[, ...]]
Group
Description
Calls an Obj method/property, ProcName, by name. Pass the exprs to the method/property.
Sandbox
Sandbox mode blocks this instruction.
Parameters
| Parameters | Description |
|---|---|
| Obj | Calls the method/property for this object reference. |
| ProcName | The name of the method/property to be called. |
| CallType | Type of method/property call. See the table below. |
| expr | These expressions are passed to the obj method/property. |
| CallType | Value | Effect |
|---|---|---|
| vbMethod | 1 | Calls or evaluates the method. |
| vbGet | 2 | Evaluates the property value. |
| vbLet | 4 | Assigns the property value. |
| vbSet | 8 | Sets the property reference. |
Example
Sub Main On Error Resume Next CallByName Err, "Raise", vbMethod, 1 Debug.Print CallByName(Err, "Number", vbGet) ' 1 End Sub