Form repaint problem

B

Benjamino5

I have a VBA form to provide the user with status on a long-running macro.
Normally, the status updates happen every few seconds without error.

Sometimes, however, the form doesn't update at all, and can even generate a
"(Not Responding)" error in the form's title bar. The macro completes
successfully, but the user thinks it's frozen.

I'm calling form.Repaint after I update the status text. Why might that be
working some of the time and not all of the time? It does seem to be related
to switching from Word to another app and back again, but it's not consistent.

I've also heard of the DoEvents command, to yield control to the OS, but
I've seen conflicting advice about how and when to use that.

Any suggestions? I can provide code samples, but really, I'm just updating
the text in the form and then calling .Repaint.

Thanks,
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top