16
\$\begingroup\$

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"?

\$\endgroup\$

1 Answer 1

21
\$\begingroup\$

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.

\$\endgroup\$
6
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – t3chb0t
    Jul 6, 2018 at 18:40
  • 7
    \$\begingroup\$ @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. \$\endgroup\$ Jul 6, 2018 at 19:25
  • 3
    \$\begingroup\$ 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) \$\endgroup\$ Jul 6, 2018 at 23:42
  • 2
    \$\begingroup\$ @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. \$\endgroup\$ Jul 6, 2018 at 23:45
  • \$\begingroup\$ 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. \$\endgroup\$
    – Mast Mod
    Jul 7, 2018 at 12:23
  • 4
    \$\begingroup\$ I don't necessarily agree with everything here, but I do definitely agree - stop downvoting these questions if it isn't clear! \$\endgroup\$ Jul 11, 2018 at 6:27

You must log in to answer this question.

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