+ Reply to Thread
Results 1 to 2 of 2

VBA Wscript Popup not closing?

Hybrid View

mrbusto71 VBA Wscript Popup not closing? 06-29-2017, 03:04 PM
mrbusto71 Re: VBA Wscript Popup not... 06-29-2017, 03:59 PM
  1. #1
    Forum Contributor
    Join Date
    05-12-2014
    MS-Off Ver
    Excel 2013
    Posts
    131

    VBA Wscript Popup not closing?

    Hey folks! Here's my code to start:
    Sub Alert()
        CreateObject("Wscript.Shell").Popup "This workbook will auto-close in 2 minutes due to inactivity.", 5000, "Auto-Close", 0
    End Sub
    Basically, I've set up some code on a worksheet to close after a certain amount of inactivity. I read up on these forums and others and people suggested using a Wscript.Shell popup instead of a msgbox that way you could set the inactivity warning to close after a set time instead of having the code hang waiting for a user to hit a button.

    The thing is, so far this works great except it also hangs and stops the code. From what I read, that 5000 in the code should specify the box close after 5 seconds, but so far it just waits for a user to click 'ok' on the popup.

    How can I alter this code so that the popup closes after a set time without requiring a user to click ok?
    Any help would be appreciated!

  2. #2
    Forum Contributor
    Join Date
    05-12-2014
    MS-Off Ver
    Excel 2013
    Posts
    131

    Re: VBA Wscript Popup not closing?

    Quote Originally Posted by mrbusto71 View Post
    Hey folks! Here's my code to start:
    Sub Alert()
        CreateObject("Wscript.Shell").Popup "This workbook will auto-close in 2 minutes due to inactivity.", 5000, "Auto-Close", 0
    End Sub
    Basically, I've set up some code on a worksheet to close after a certain amount of inactivity. I read up on these forums and others and people suggested using a Wscript.Shell popup instead of a msgbox that way you could set the inactivity warning to close after a set time instead of having the code hang waiting for a user to hit a button.

    The thing is, so far this works great except it also hangs and stops the code. From what I read, that 5000 in the code should specify the box close after 5 seconds, but so far it just waits for a user to click 'ok' on the popup.

    How can I alter this code so that the popup closes after a set time without requiring a user to click ok?
    Any help would be appreciated!
    Nevermind folks, was able to make it work by abandoning the wscript popup and instead using a userform with an action in a module set to show the userform instead

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to enter something into cell when WScript.Popup box is active?
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-22-2015, 01:03 PM
  2. [SOLVED] Closing Excel Path Popup
    By Fjcosta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2014, 10:14 AM
  3. popup alert message during the worksheet open and continuous work on the sheet popup jump
    By shailkam2001 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-04-2014, 10:24 AM
  4. Replies: 2
    Last Post: 01-03-2013, 04:32 PM
  5. [SOLVED] CreateObject("WScript.Shell").Popup
    By MyComputerGuy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-14-2012, 09:18 AM
  6. Replies: 4
    Last Post: 05-07-2012, 07:13 PM
  7. [SOLVED] using WScript.CreateObject("Wscript.Shell
    By John Keith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-30-2005, 02:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1