So I wrote a little code to run through a table and trim all the cells. As has happened in the past, Excel will "lock up" during code execution so I can't tell if it's still running, confused, broken, or angry. (Does Excel get angry? Perhaps, heh.)
I learned a few months ago that putting in the 'DoEvents' command would allow the application to update the screen, or some such thing, so that any update messages would be sent to the Status Bar and the whole business wouldn't lock up. However, it seems that adding 'DoEvents' increases the time required for executing the sub.
For example, in a table with ~53000 cells, it took 6.5 minutes to Trim all the cells with 'DoEvents' included, versus 3.5 minutes without.
Is there a better way to keep Excel (or other Office applications for that matter) from locking up during code execution? Or is there a way to throw something up on the screen to let the user (usually me) know "Hey, everything is OK, I haven't locked up, just running through the code"?
Thanks!!
Matt
I learned a few months ago that putting in the 'DoEvents' command would allow the application to update the screen, or some such thing, so that any update messages would be sent to the Status Bar and the whole business wouldn't lock up. However, it seems that adding 'DoEvents' increases the time required for executing the sub.
For example, in a table with ~53000 cells, it took 6.5 minutes to Trim all the cells with 'DoEvents' included, versus 3.5 minutes without.
Is there a better way to keep Excel (or other Office applications for that matter) from locking up during code execution? Or is there a way to throw something up on the screen to let the user (usually me) know "Hey, everything is OK, I haven't locked up, just running through the code"?
Thanks!!
Matt