wwbwb
Well-known Member
- Joined
- Oct 20, 2003
- Messages
- 513
I have the following code in an error trap
From my understanding, when the condition is met for the code to come here, a msgbox will pop up. It should last for 2 seconds then disappear then it should goto beginning0 ( a label for it to go back to the beginning of the code to start over). But what it does is either...
1.(usually) the msgbox will not disappear after 2 seconds, instead it sits there waiting until someone presses the OK button then it disappears and immediately reappears and does the same thing over and over or...
2.(rarely) it will disappear after 2 seconds then immediately reappear and either wait 2 seconds and disapper or sit there and wait until someone presses the OK button and then does the same thing over and over.
Never does it actually call the next line of code for it to GoTo beginning0
It works perfectly if I stepinto it and process it line by line though, but not when its run.
Any ideas???
Code:
error:
Sheets("stocks").Select
CreateObject("WScript.Shell").Popup "Unable to retreive information. Retry in 2 seconds", 2, "Unable to query"
GoTo beginning0
From my understanding, when the condition is met for the code to come here, a msgbox will pop up. It should last for 2 seconds then disappear then it should goto beginning0 ( a label for it to go back to the beginning of the code to start over). But what it does is either...
1.(usually) the msgbox will not disappear after 2 seconds, instead it sits there waiting until someone presses the OK button then it disappears and immediately reappears and does the same thing over and over or...
2.(rarely) it will disappear after 2 seconds then immediately reappear and either wait 2 seconds and disapper or sit there and wait until someone presses the OK button and then does the same thing over and over.
Never does it actually call the next line of code for it to GoTo beginning0
It works perfectly if I stepinto it and process it line by line though, but not when its run.
Any ideas???