Some VBA questions mention the host application (e.g. Excel) is going "not responding" while their macro is running.

Is it ok to vote to close these questions as "broken code"?

up vote 22 down vote accepted

If you don't do VBA, you probably don't know this, but most VBA host applications are single-threaded, and when VBA code runs for a long time it's completely normal that the main window's caption says "(not responding)" until the code completes.

THIS IS NOT BROKEN CODE.

So please stop downvoting and voting to close Excel/VBA questions as "broken code" whenever the OP mentions Excel going "not responding".

Thank you.


However

If the OP is only asking about why this is happening and how they can fix it, then they're not asking for a peer review and they're likely asking a question that should be on Stack Overflow, if they're not looking for feedback on any/all aspects of their code.

  • 1
    there is a BUT... we should differentiate between not responding for some time and not responding forever which might indicate broken code. You cannot say that any non-responding application is working correctly. Maybe there is an infinite-loop in it? It always depends on how OP formulates the question. I will cast a broken-code vote if I get the impression that the lack of responsivnes is caused by a bug. So the bottom line is it should be decided on case by case basis. You're right, most of them aren't broken but saying none of them are isn't right either. – t3chb0t Jul 6 at 18:40
  • 6
    @t3chb0t "Welcome to CR! Excel going 'not responding' is normal behavior. Does your code eventually run to completion?" is much more helpful than unwarranted down+close votes though. – Mathieu Guindon Jul 6 at 19:25
  • 3
    I was about to upvote this, but I don't entirely agree that it should be closed for "not asking a review" if they only ask about that. In my world, it's perfectly okay to only ask for performance improvements on Code Review. (but answers should be free to mention anything anyway) – Simon Forsberg Jul 6 at 23:42
  • 2
    @Simon that's not what I meant. Of course it's ok to ask about performance improvements - but the host app going unresponsive only ever has 1 reason to happen: UI thread is busy running your code, and you can avoid it with DoEvents but that will slow down execution, not improve it. Asking "why is Excel not responding and how can I fix this?" is blatant SO territory IMO. – Mathieu Guindon Jul 6 at 23:45
  • Besides, talking about your last paragraph, if we tell them it's normal behaviour as long as the code eventually completes, 2 things happen: either it does and the problem is no longer a problem (case closed, nobody cares about the question anymore so it can be safely closed/removed) or it won't and it's SO territory. One way or another, a comment is more helpful than a review here. – Mast Jul 7 at 12:23
  • 4
    I don't necessarily agree with everything here, but I do definitely agree - stop downvoting these questions if it isn't clear! – Raystafarian Jul 11 at 6:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .