ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Question (https://www.excelbanter.com/excel-programming/271741-vba-question.html)

Justin Starnes

VBA Question
 
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?



Robin Hammond

VBA Question
 
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/E...rogressBar.htm.

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


"Justin Starnes" wrote in message
...
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?






All times are GMT +1. The time now is 10:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com