CALLBYNAME(object, procname, calltype [,args])

Returns, sets or executes a method or property of an object (Variant).


objectThe object name which the function will be executed on (Object).
procnameThe name of a property or method of the object (String).
calltypeA vbCallType constant that specifies the type of procedure being called:
vbGet
vbLet
vbMethod
vbSet
args(Optional) The array of possible arguments (Array).

REMARKS
* This only works with class objects.
* If your code is not in a class then you can use Application.Run.
* This function is used to get or set a property, or invoke a method at run time using a string name.
* This function was added in Office 2000.
* The equivalent .NET function is Microsoft.VisualBasic.Interaction.CallByName
* For the Microsoft documentation refer to docs.microsoft.com

Call CallByName("txtName1", "MousePointer", vbLet, vbCrosshair) 

vResult = CallByName("txtName1", "MousePointer", vbGet)

Call CallByName("txtName1", "Move", vbMethod, 100, 100)

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top