cheng
10-24-2015, 12:35 AM
Hi,
I have a macro that opens an external workbook and does some processing to it. I am using a modeless userform to notify the user on the progress of the macro, and also to enable the user aborting the macro.
My problem is that the userform is constantly being sent to the back (i.e. disappears) and pops up again during the execution if the database is very large and the macro needs to run for a long time. Also, the cancel button that I put on the userform is not very effective because it takes a long time to respond, if at all (of course it cannot work if the userform is hiding behind the workbook...).
I tried using DoEvents as was suggested in other threads on this topic, but it doesn't seem to be very reliable.
If necessary, I am willing to use the status bar instead of the userform to indicate progress, but what can I do to make the cancel button work effectively?
Thanks,
Chen
I have a macro that opens an external workbook and does some processing to it. I am using a modeless userform to notify the user on the progress of the macro, and also to enable the user aborting the macro.
My problem is that the userform is constantly being sent to the back (i.e. disappears) and pops up again during the execution if the database is very large and the macro needs to run for a long time. Also, the cancel button that I put on the userform is not very effective because it takes a long time to respond, if at all (of course it cannot work if the userform is hiding behind the workbook...).
I tried using DoEvents as was suggested in other threads on this topic, but it doesn't seem to be very reliable.
If necessary, I am willing to use the status bar instead of the userform to indicate progress, but what can I do to make the cancel button work effectively?
Thanks,
Chen