Excel – Run a Macro from Different Workbook

Execute a macro in a different workbook

IMPORTANT: If you give the same name to two different procedures in two different projects, you must specify a project name when you call that procedure.

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 [gs function] in a DLL or XLL.

Sub Run_Macro_In_Different_WorkBook()
Application.Run "'C:/CanBeDeleted.xlsx.xlsm'!AnotherWrkBook_Macro"
End Sub

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

Sub Run_Macro_In_Different_WorkBook_With_Arguments()

On Error GoTo Err_Trap

Application.Run "'C:\CanBeDeleted.xlsx.xlsm'!Function_Two_Args", "Argument 1", "Argument 2"

Err_Trap:
If Err <> 0 Then
Debug.Print Err.Number & Err.Description

End If
End Sub
SOURCE

LINK (Vbadud.blogspot.com)

LANGUAGE
ENGLISH