I'm writing something in Excel 97 VBA which needs a response from a messagebox within a certain time. An item is shown and the user has to click "Yes" or "No" within five seconds. After they click Yes or No it records their response and the time taken and moves on to the next item, or after five secons it records a nil response and moves on by itself.
(so the sequence is: item appears, timer starts, messagebox appears, user clicks Y/N, messagebox closes, time since appeareance is noted, response and time taken are recorded, next item appears.)
Trouble is that if there is no reponse within 5 seconds it needs to move on automatically, and I can't get the messagebox to timeout. The rest works fine but the messagebox takes control until it gets a response. It doesn't check the loop timer until after the reponse, ie the messagebox is closed and relinquishes control to the loop, so I can't get the loop to check that it has reached 5 seconds.
I thought about the user simply putting Y or N in a text box, but hit a similar problem - it will not allow a change to the text box until the loop is finished.
Anyone got any suggestions?
Thanks
(so the sequence is: item appears, timer starts, messagebox appears, user clicks Y/N, messagebox closes, time since appeareance is noted, response and time taken are recorded, next item appears.)
Trouble is that if there is no reponse within 5 seconds it needs to move on automatically, and I can't get the messagebox to timeout. The rest works fine but the messagebox takes control until it gets a response. It doesn't check the loop timer until after the reponse, ie the messagebox is closed and relinquishes control to the loop, so I can't get the loop to check that it has reached 5 seconds.
I thought about the user simply putting Y or N in a text box, but hit a similar problem - it will not allow a change to the text box until the loop is finished.
Anyone got any suggestions?
Thanks