Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Macro Object / RunMacro2 Method
A MacroEnumerationOption Enumeration value that specifies the location of the macro. MacroEnumerationOption_Document specifies a macro in the session document's VBA project. MacroEnumerationOption_Common specifies a macro in the Common VBA project.
The name of the macro to run.
Example
In This Topic
    RunMacro2 Method (Macro)
    In This Topic
    Runs a macro that takes no parameters.
    Syntax
    expression.RunMacro2( _
       ByVal macroSource As MacroEnumerationOption, _
       ByVal macroName As String _
    ) 
    where expression is a variable that represents a Macro Object

    Parameters

    macroSource
    A MacroEnumerationOption Enumeration value that specifies the location of the macro. MacroEnumerationOption_Document specifies a macro in the session document's VBA project. MacroEnumerationOption_Common specifies a macro in the Common VBA project.
    macroName
    The name of the macro to run.
    Remarks

    For more about using the RunMacro2 method, see:

    Controlling Macro Execution

    Example
    This sample runs a macro. To run this sample, paste the code into a module named "Module1" and then run the RunMacro2Example macro.
    Sub RunMacro2Example()
      
        ThisIbmTerminal.Macro.RunMacro2 MacroEnumerationOption_Document, "Module1.SimpleMacro"
     
    End Sub
     
    Sub SimpleMacro()
        MsgBox ("A simple Macro")
    End Sub
    See Also