RC-WinTrans Object Model Help |
VBATool.RunMacro
|
Runs the given macro in the given module and macro file. If the call was succesfull the method returns "True", otherwise "False."
Syntax: |
RunMacro( ProjectName As String, ModuleName As String, MacroName As String, ParametersArray As Variant ) As Boolean |
| Return: | Boolean |
| Parameters: |
ProjectName Name of the project where the macro is located. ModuleName Name of the module where the macro is located MacroName Name of the macro. ParametersArray Array with the necessary parameters.
|
| Example: | Dim Tool As VBATool
Dim IsSuccessfull As Boolean
' 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
IsSuccessfull = Tool.RunMacro("MyMacros", "MyModule", "MyMacro", ParamAry)
|
| Remarks: | The size of the parameter array must be equal to the parameters of the macro that is called. If the parameter array contains only one element it must be declared as follows: Dim ParamAry(0) As Variant. |
See also: