I'm sure this has come up before but I'm having a hard time getting a warning message box to pop up and then close after 10 seconds. I have a 30 minute timer which warns the user after 25 minutes and then closes the workbook after 30 minutes. The code I'm using is:
CreateObject("WScript.Shell").Popup "This workbook has been open for 25 minutes. You have 5 minutes to save your work before Excel closes.", 10, "Warning"
Which, if I put it in a sub and then run the sub, it works fine. But if I call the sub from another sub the message stays open and stops execution of the remaining code until I click the OK button - it does not close after 10 seconds. If I put the command inside the timer sub the same thing happens. I'm not sure what's going on here. Anyone have any ideas on how I can correct this? I need two boxes to open for 10 seconds and then close, one at a 5 minute warning (after 25 minutes) and one saying Excel is closing in 10 seconds.
CreateObject("WScript.Shell").Popup "This workbook has been open for 25 minutes. You have 5 minutes to save your work before Excel closes.", 10, "Warning"
Which, if I put it in a sub and then run the sub, it works fine. But if I call the sub from another sub the message stays open and stops execution of the remaining code until I click the OK button - it does not close after 10 seconds. If I put the command inside the timer sub the same thing happens. I'm not sure what's going on here. Anyone have any ideas on how I can correct this? I need two boxes to open for 10 seconds and then close, one at a 5 minute warning (after 25 minutes) and one saying Excel is closing in 10 seconds.