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
Doug Robbins - Word MVP - 12 Sep 2007 08:18 GMT
Fellow MVP/Bill Gates look-alike, Albert Kallal has a status bar routine in
his website at:
http://www.members.shaw.ca/AlbertKallal/wordmerge/index.html
I have used that successfully in a number of applications.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>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.
[quoted text clipped - 18 lines]
> Thanks,
> Ben