VBA Error on Exit Sub

Excel18

New Member
Joined
Jul 12, 2016
Messages
5
Hello,
I have several macros configured to pull data into a worksheet. They both function correctly until the very end of the code, when I get an error on Exit Sub. This error is "Code execution has been interrupted". This does not occur every time the macro is run, and if I run it under the same conditions without closing the sheet it only fails every 4-5 times.

Does anyone have any advice on fixing this problem?
Thank you
 
I'm actually not able to post the code. However, I think I have found a solution. Since the error and corresponding pop-up only occur at the very end of the macros, I put "Application.EnableCancelKey = xlDisabled" immediately before the End Sub.

Thank you for your willingness to help!
 
Upvote 0

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