P114 Run a Macro

/P#

Meaning

Extra Parameters: /1{Parameter1} … /n{Nth Parameter}

114

Run a Macro

/1 = sMacroName

/2 = bSaveAfterRunning (“TRUE” or “FALSE”). Set to “TRUE” to save the workbook after running the macro. You must specify the /T command line argument if you set this to true.

/3 = sArg1 Use the next 8 parameters (/3-/10) if and only if your macro requires arguments.

/4 = sArg2

/5 = sArg3

/6 = sArg4

/7 = sArg5

/8 = sArg6

/9 = sArg7

/10 = sArg8

This special process can run a macro that you specify and optionally save the workbook after execution.

Writing Excel macros is beyond the scope of this manual; please check your Excel documentation for assistance.

Special Parameters Described in Detail

/1{sMacroName} The syntax for specifying a macro is:

ObjectName.MacroName

If the macro is located in a separate workbook use this syntax:

‘FullPath’!ObjectName.MacroName

ObjectName can be any defined object with a workbook VBA area such as Sheet1, Sheet2, Module1, ThisWorkbook etc. If specifying a FullPath be certain to add the single quotes. For example this would be a valid entry:

/1'c:\path\WorkbookWithMacros.xls'!module1.MacroName

/2 {bSaveAfterRunning} To save the workbook after execution of the macro, set this parameter to “TRUE”, else “FALSE”.

/3 … /8 {sArg1…Arg8} If your macro has arguments/parameters that need to be passed to it, use sArg1-sArg8 to facilitate this.

Examples:

Example 1: Run a Macro