Using Application.OnTime as a progress bar on screen

chuckchuckit

Well-known Member
Joined
Sep 18, 2010
Messages
541
Am wondering what kind of hidden problems may be encountered if doing the following:

Using "Application.OnTime" every few seconds to launch a small macro that will be used as a time status bar updating the screen with a bar length that changes.

It will draw a different length on screen every few seconds to show time duration etc. It will then call another "Application.OnTime" set to run the macro again a few seconds later for the next screen status update.

This avoids having a macro run continually that would not allow keyboard use when that macro would be running during the full status bar time involved.

Since this will be calling "Application.OnTime" thousands of times during the day, do I need to do something to clean up after using each "Application.OnTime" or does it clean up after itself and not cause any trouble from my calling it thousands of time automatically?

Thanks.

Chuck
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Looks like there is no problem at all calling as many "Application.OnTime" calls as you want. Once they launch themselves, it appears their function is done so no ill effects. Watch Windows Task Manager and Windows Resource Monitor and no memory problems there etc.

Works great for a painting a progress bar on the screen without a constant looping macro.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,256
Members
452,901
Latest member
LisaGo

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