Does the VBA editor have the ability to detect if a macro has been paused

x-amount

Active Member
Joined
May 16, 2003
Messages
260
I am writing a macro that runs a list of macros, the list of which is chanegablem, and defined in a table on a worksheet (using application.run(range("A1").value) etc)

However whilst this is all in the develpment stage, and I frequently pause the macros (or an error is found!).

I have an idea that will enable me to 'time' each macro run thus allowing me to estimate an eta for it's run completion. I will have the last 10 uninterrupted runs of each macro then average them out to calculate the total eta.

However, I need to be able to not add a run of each macro to the average time calculation if I have paused the run of the macro. My question is then: Is it possible to detect the pausing (or error-ing) of a macro?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Thanks for your response, but not how that would work with regards to manual ctrl+break pauses?

A pause is not an error (or is it?!)
 
Upvote 0
It is if you add:
Code:
   Application.EnableCancelKey = xlErrorHandler
to your code.
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,153
Members
452,891
Latest member
JUSTOUTOFMYREACH

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