If you are running a loop and wish to give the user the ability to cancel make sure you use the Yield() function to allow other processes a chance run. The same goes for any background processing.