Runs the given function in the given module and macro file. The return value of this function is the return value of the VBA function called.

Syntax:

RunFunction( ProjectName As String, ModuleName As String,
FunctionName As String, ParametersArray As Variant ) As Variant
Return: Variant
Parameters: ProjectName Name of the project where the function is located.
ModuleName Name of the module where the function is located.
FunctionName Name of the function.
ParametersArray Array with the necessary parameters.

Example:
Dim Tool As VBATool
Dim ReturnValue As Variant

' no parameters
Dim ParamAry As Variant

' 3 parameters
Dim OtherParamAry(2) As Variant
Set OtherParamAry(0) = Application.ActiveProject
Set OtherParamAry(1) = Application.ActiveProjectFile
Set OtherParamAry(2) = Application.ActiveTransUnit


Set Tool = Application.Tools.VBATool

ReturnValue = Tool.RunFunction("MyMacros", "MyModule", "MyFunction", ParamAry)
Remarks: The size of the parameter array must be equal to the parameters of the function that is called.

If the parameter array contains only one element it must be declared as follows: Dim ParamAry(0) As Variant.

See also:

Class VBATool


Last Updated: 04/27/05