Ricky Morris
Active Member
- Joined
- Mar 31, 2002
- Messages
- 363
What's the syntax to call a macro in another workbook?
Thanks,
Ricardo
Thanks,
Ricardo
Sorry to bring up an old thread... but I'm trying to do this too, but the macro is contained on a worksheet
Application.Run "'My Workbook.xlsb'!shtMySheet.MyMacro"
Application.Run "'My Workbook.xlsb'!MyModule.MyMacro"
OtherExcelApplication.Run "'My Workbook.xlsb'!shtMySheet.MyMacro"
strMacro = "'" & wbPlan.Name & "'!Module4.Activity_Type_Validation"
strMacro = "'" & wbPlan.Name & "'!Activity_Type_Validation"
Application.Run strMacro
Application.Run (strMacro)
Sub Activity_Type_Validation(Ws As Worksheet)
Iall combinations return a run time error 449 Argument not optional.
"""""""
Workbookname = Book.xlsm (need to be XLSM)
macroname = Macro (add macro name, the one after "SUB" no module name)
Correct form in case workbook and macro name are variables = Application.Run "" & workbookname & "" & "!" & "" & macroname & ""
xlsb will work - it does not have to be xlsm specifically, just needs to be macro-enabled, obviously.
Application.Run ("'MBU_Tracking_Workbook-v62-unlocked.xlsm'!GlobalRemNamedRanges")
[COLOR=#333333][I]Application.Run ("'" & workbookname & "'!macroname")[/I][/COLOR]
Application.Run "'" & TrackingWorbook.Name & "'!GlobalRemNameRanges"