2

Why VBA says it & ldquo; (Not in response) & rdquo; Even when the code w...

 2 years ago
source link: https://www.codesd.com/item/why-vba-says-it-not-in-response-even-when-the-code-works-well.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Why VBA says it & ldquo; (Not in response) & rdquo; Even when the code works well?

advertisements

I've run into this issue with many different VBA programs, so I'm thinking I may have some incorrect settings in Excel or the VBA editor. Honestly, I'm pretty clueless after a lot of web searching.

Basically, I'll be running a normal piece of code and the application (both Excel and the VBA Editor) will go into (Not Responding) mode. However the code is running fine. Once the code is finished, the application will no longer be in non-responsive mode and everything returns to normal

Really kinda frustrating on users who think something is wrong when really it's just taking a while to run the code.

Any help would be great! Thanks!


Try putting DoEvents statements in your code, so that DoEvents is executed every so often during a lengthy process. See http://support.microsoft.com/kb/118468/en-us

This will return control to the OS, so that the OS can do what it needs to do while your program is running, and this should prevent the OS from thinking that your program is not responding.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK