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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,214,968
Messages
6,122,506
Members
449,089
Latest member
RandomExceller01

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