VBA Question

  • Thread starter Thread starter Justin Starnes
  • Start date Start date
J

Justin Starnes

I have a userform that performs a very expensive (time consuming) operation
when the user clicks ok. Is there is any way to allow the cancel button to
be pressed while performing the operation? I believe that this is not
possible with VBA as I believe that Excel is single threaded. Can anyone
confirm this?
 
There's always the end command but you might need to manage the consequences
if it is half way through something.

You would have to display the form as modeless in xl2000 or higher to be
able to allow the user to interact with the form while the process is
running. A cleaner method might be to display a modeless progress bar and
allow the user to cancel if it is taking too long. There's an example on my
site at http://www.enhanceddatasystems.com/ED/Pages/ExcelProgressBar.htm.

Robin Hammond
www.enhanceddatasystems.com
Check out our XspandXL add-in
 
Back
Top