+ Reply to Thread
Results 1 to 6 of 6

CreateObject("WScript.Shell").Popup

  1. #1
    Registered User
    Join Date
    11-07-2011
    Location
    Wisconsin USA
    MS-Off Ver
    Excel 2016
    Posts
    18

    CreateObject("WScript.Shell").Popup

    Im having an issue with: CreateObject("WScript.Shell").Popup "Thank You and Enjoy Your Class.", 2, "Thank You!" It doesnt dissappear after the 2 sec like it should, any ideas??

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: CreateObject("WScript.Shell").Popup

    the shell popup is unreliable. sometimes it works, sometimes not. you'd be way better off using a userform instead if you want a timed message (you can also use apis to dismiss a message box, but a userform is simpler.)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    11-07-2011
    Location
    Wisconsin USA
    MS-Off Ver
    Excel 2016
    Posts
    18

    Re: CreateObject("WScript.Shell").Popup

    i agree but a pop up window is what is in the system now and the customer does not want it changed. i'll have to wait and see if someone has an answer.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: CreateObject("WScript.Shell").Popup

    you can make a userform look pretty much exactly like a popup message box.

  5. #5
    Forum Contributor
    Join Date
    01-20-2012
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: CreateObject("WScript.Shell").Popup

    You can also add 4096 to it, to make it topmost window.
    It won't be effected by losing focus then.
    Still remains unreliable like JosephP said.
    I think you should convince your customer userforms should be the way to go.

    CreateObject("WScript.Shell").Popup "Thank You and Enjoy Your Class.", 2, "Thank you", 4096

  6. #6
    Registered User
    Join Date
    05-14-2012
    Location
    Elmhurst, Australia
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: CreateObject("WScript.Shell").Popup

    There are comments re reliability of above command - I have noticed that Vista seems less reliable. Also repetitive quick testing may lead to some unusualy behaviour where the output gets thrown to windows behind the excel window (one needs to remember that it in actually fact a call away from Excel)

    To Joseph P suggesting the development of a User-Form - bit more work but better mousetrap with more control over timers and 'Yes' button ie you don't need one. You can start to get the feel of the WAIT statement from the XBase languages. Seems to me that MS has thrown out lot of nice features from previous languages with the bathwater. Good luck MyComputerGuy convincing the customer.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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