Home » excel » vba – Running an Excel macro from another workbook

vba – Running an Excel macro from another workbook

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have a subroutine that opens a workbook containing a macro. I then want to run that macro. My code looks like this:

Source = "C:\Users8896\Desktop\Moje Makra\newidea-inbound-query.xlsm"

Workbooks.Open (Source)

Application.Run "newidea-inbound-query.xlsm!InboundQueryMacro"

The name of the macro is correct, it is in Module1, all macros are enabled.

I get the error:

Macro may not be available in this workbook or all macros may be disabled

How to&Answers:
Application.Run ("'Name of the book'!ModuleName.SubName")