Calling Macro In Another Workbook

ConradBartimus

New Member
Joined
Sep 19, 2015
Messages
24
I am Stupid haha.

Please help me, I have two auto refreshing workbooks. Both workbooks are running smooth (approximately every 5 minutes). I have changed the Auto Refreshes to call a macro within the current work book(in both work books), the macro being called "should" call the macro in the other workbook and then activate the auto refresh. This in turn "should" call the original macro and create an infinite loop.

Here are the four macros:

Book1- (AnotherBrookInTheWall)


Sub All()
Call LRB
Call LoadBalance
Call Promise
Call RunRisk
Application.OnTime Now + TimeValue("00:02:15"), "PG"
End Sub


Sub PG()
Workbooks("PgOneStop").Activate
Workbooks("PgOneStop").Application.Run ("!Auto")

End Sub


Book2- (PgOneStop)


Sub Auto()

Call All
Application.OnTime Now + TimeValue("00:02:00"), "Brook"

End Sub


Sub Brook()

Workbooks("AnotherBrookOnTheWall").Activate
Workbooks("AnotherBrookOnTheWall").Application.Run ("!All")

End Sub



The Error I am getting is:

"Run-time error '1004':

"Cannon run the macro '!Auto'. The macro may not be available in this workbook or all macros may be disabled."

Does anyone know what is causing this.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top