Application.Run (Excel)

Runs a macro or calls a function. This can be used to run a macro written in Visual Basic or the Microsoft Excel macro language, or to run a function in a DLL or XLL.

You cannot use named arguments with this method. Arguments must be passed by position. The Run method returns whatever the called macro returns.

Run (Macro, Arg1, ..., Arg30)


Dim strRun As String
strRun = Run()

Arguments

Macro, Arg1, ..., Arg31

Optional arguments

The following argument is optional

Macro (Range) - The macro to run. This can be either a string with the macro name, a Range object indicating where the function is, or a register ID for a registered DLL (XLL) function. If a string is used, the string will be evaluated in the context of the active sheet.

Arg30 - An argument that should be passed to the function