execute_macro 
You use this method to execute a macro in the office application
Syntax
CALL METHOD document->execute_macro EXPORTING macro_string = macro_string param_count = param_count script_name = script_name param1 = param1 param2 = param2 param3 = param3 param4 = param4 param5 = param5 param6 = param6 param7 = param7 param8 = param8 param9 = param9 param10 = param10 param11 = param11 param12 = param12 no_flush = no_flush IMPORTING error = error retcode = retcode CHANGING error_string = error_string retvalue = retvalue.
Parameter |
Optional |
Description |
|
The name of the macro in the office application |
|
|
X |
' ': The macro is part of the document <name>: The macro is placed in the script collection under this name. |
|
X |
Number of parameters to be passed to the macro |
|
X |
The parameters to be passed to the macro (not Word 97) |
|
X |
The internal error code from the application macro is returned to the ABAP side, and can be handled there. This suppresses the normal VB dialog box. |
|
X |
Value generated by the application macro. |
Note
If you are using Word, you cannot pass any parameters to the macro.
You can also specify the name of a template, add-in, or VBA module in the form 'template_name.macro_name' or 'module_name.macro_name'.