RunMacro method

Official Content
This documentation is valid for:

Runs the indicated Macro contained in the document, with the specified parameters.


&DataType.RunMacro(MacroName [ , Par1 ... [ , Par30 ] ] )

Par1 ... Par30
   Are parameters used by the macro. 

Type Returned:


Extended Data Types: ExcelDocument, WordDocument
Generators: Visual Basic (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)


  • The parameters are only input parameters. If the called macro returns values, these will remain stored in the MacroReturnText, MacroReturnNumber and MacroReturnDate properties, according to their types. 
  • There is a maximum of 30 parameters. This is a Word limitation.
  • If this method is used with Office 97, it is not possible to use parameters. This is an Office 97 limitation. Thus, in this case, invoking MacroReturnText, MacroReturnNumber and MacroReturnDate properties is not possible either.
  • This method returns an error code, so it is possible to call it as a function (&Err = &DataType.RunMacro(…..)).

See Also

MacroReturnDate Property
MacroReturnNumber Property
MacroReturnText Property
ExcelDocument Data Type
WordDocument Data Type