This document is archived and information here might be outdated. Recommended version. |
Runs the specified VBA macro.
[Visual Basic .NET] Public Function RunVBAMacro ( _ ByVal docName As String, _ ByVal moduleName As String, _ ByVal macroName As String, _ ByRef arguments As Object _ ) As Object
[C#] public object RunVBAMacro ( string docName, string moduleName, string macroName, ref object arguments );
docName specifes the name of the VBA project that contains the macro you want to run.
moduleName specifes the name of the module that contains the macro you want to run.
MacroName specifies the name of the macro you want to run.
arguments is a Variant array that represents the arguments that you want to pass into this macro.
If the macro is in the current document, docName will be "Project".
If the macro is in the Normal template, docName will be "Normal".
If the macro is in a template, docName will be "TemplateProject".
If you want to pass arguments into this macro you are running, first add the arguments to an array and then use that array for arguments parameter of the RunVBAMacro method.