ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MSGBOX not working (https://www.excelbanter.com/excel-programming/366752-msgbox-not-working.html)

Peter Rooney

MSGBOX not working
 
Good afternoon, all,

Has anyone ever come across instances of MSGBOX not displaying, even when
it's obvious that the code is processing the command?
I'm using MSGBOXes to debug some code - some of them work and some of them
don't, thought they all should, as the code goes past them all.
Any thoughts?
Thanks in advance
Pete

Norman Jones

MSGBOX not working
 
Hi Peter,

Try putting a breakpoint at the first msgbox and when the code stops, use
the immediate window to check the condition which should trigger the
display. This will also verify that the relevant line is not being bypassed
due to earlier branch in the code - do you have an error handler for
example?


---
Regards,
Norman



"Peter Rooney" wrote in message
...
Good afternoon, all,

Has anyone ever come across instances of MSGBOX not displaying, even when
it's obvious that the code is processing the command?
I'm using MSGBOXes to debug some code - some of them work and some of them
don't, thought they all should, as the code goes past them all.
Any thoughts?
Thanks in advance
Pete




Peter Rooney

MSGBOX not working
 
Norman,
I sorted it - I had a SendKeys command that was supposed to send some
{Enter}s to suppress warning messages - unfortunately, whilst they were used
in the application from whiuch i copied the code, they weren't needed in this
one - hence the MsgBox es effectively had their "OK" buttons clicked, so
didn't appear to appear (if you see what I mean)
That'll teach me to take a break more often in the afternoon! :-)
Thanks for your time
Pete

"Norman Jones" wrote:

Hi Peter,

Try putting a breakpoint at the first msgbox and when the code stops, use
the immediate window to check the condition which should trigger the
display. This will also verify that the relevant line is not being bypassed
due to earlier branch in the code - do you have an error handler for
example?


---
Regards,
Norman



"Peter Rooney" wrote in message
...
Good afternoon, all,

Has anyone ever come across instances of MSGBOX not displaying, even when
it's obvious that the code is processing the command?
I'm using MSGBOXes to debug some code - some of them work and some of them
don't, thought they all should, as the code goes past them all.
Any thoughts?
Thanks in advance
Pete





Peter Rooney

MSGBOX not working
 
Crazybass2,
Thanks for your advice, but it was something a bit more simple than I
thought - I had a SendKeys command that was supposed to send some {Enter}s to
suppress warning messages - unfortunately, whilst they were used in the
application from whiuch i copied the code, they weren't needed in this one -
hence the MsgBox es effectively had their "OK" buttons clicked, so didn't
appear to appear (if you see what I mean)
That'll teach me to take a break more often in the afternoon and use
application.displayalerts=false! :-)
Thanks for your time
Pete


"crazybass2" wrote:

You can also use F8 to follow the code as it's running.


"Norman Jones" wrote:

Hi Peter,

Try putting a breakpoint at the first msgbox and when the code stops, use
the immediate window to check the condition which should trigger the
display. This will also verify that the relevant line is not being bypassed
due to earlier branch in the code - do you have an error handler for
example?


---
Regards,
Norman



"Peter Rooney" wrote in message
...
Good afternoon, all,

Has anyone ever come across instances of MSGBOX not displaying, even when
it's obvious that the code is processing the command?
I'm using MSGBOXes to debug some code - some of them work and some of them
don't, thought they all should, as the code goes past them all.
Any thoughts?
Thanks in advance
Pete






All times are GMT +1. The time now is 06:57 AM.

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