How can i keep a non-modal form on top and painted during a macro?

TomCon

Active Member
Joined
Mar 31, 2011
Messages
385
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I have a VBA macro, and wanted it to report statistics on its progress as it runs, on a user form, that i periodically update within a loop with new numbers. The form is shown with modal=False. But, it does not stay on top. In fact, it flashes throughout the macro, for a moment, visible, then not visible, then it comes back. Also, it is usually blank, you just see the form's window's title bar and outline, but just blank content within the form. Every time i actually update the form, i do Form.repaint, and at that time, you actually see the labels and statistics on the form, briefly, before it disappears again.

Can anybody tell me how to keep this form on top, and painted, while the macro runs? Or, in alternaive, how is it usually handled to have progress visible and indicated during a macro? I do not want a modal dialog that i have to dismiss, as the macro can run for a long time.

Thanks!
Tom
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,224,594
Messages
6,179,792
Members
452,942
Latest member
VijayNewtoExcel

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