Msg Box stopping Macro from running

Brazz1

New Member
Joined
May 14, 2018
Messages
3
Hi,

I am looking for help with a Macro I created. The macro opens 12 other workbooks and copies dynamic data from each workbook. The issue I have is twofold, I created a Msg Box that tells the user "This Workbook will close in 15 mins" and then excel dialogue box opens up and asks me if I want "Save my changes" at the end of each workbook.

So when I run the Macro, it open the workbook, the message box appear, I have to OK for it to move to the next phase and when I have completed my task within that workbook, excel asks “Do I want to Save the changes”, so I have to click No, Not to save any changes.

So I have to click the through Macro 24 times for it to run correctly.

It there any way I can I bypass these pop ups by using some code? Any help or suggestions are greatly appreciated.

Rgd’s
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
You could temporarily disable events as these other workbooks are opened/closed.
Code:
Application.EnableEvents = False

' code to open/close workbooks and do stuff

Application.EnableEvents = True
If you want to stop the 'save changes' prompt either close the workbooks with SaveChanges:=False or temporarily disable alerts.
 
Upvote 0
Another option is to use the Status Bar for your messages... not as "visible" as MessageBoxes but they do not interfere with the flow of code...

Application.StatusBar = "Hello"
 
Upvote 0
Re: Msg Box stopping Macro from running..Solved

Folk's sorry for the slow response. I have only been able to test your imputs today and they work perfectly. Thank you so much
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,603
Members
449,038
Latest member
Arbind kumar

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