Solve: Adding in DoEvents in the code removed the random halts.
I have been exploring the more entertaining sides of excel recently, mostly by various animations performed through vb-algorithms. By manipulating the fill-color in cells, I have been able to replicate a simple snake-game, fireworks-animations and now a simple wave-simulation.
However, upon execution of any of these little programs, it seems as though the code stops executing after about 5-10 seconds or so.
Task manager says excel is using ~100% cpu for the entire execution of the program. After the program is seemingly halted, the cpu usage is still 100%, and the worksheet is "locked" as though a program was running some code on it. I need to press CTRL+break to stop the code properly, after which I can restart the code without any problems for the next 5-10 seconds.
Surely I must be missing something.
Here is the code for the wave-simulator (with no real delay, thus making the animation way too fast on any new computers):
Bookmarks