+ Reply to Thread
Results 1 to 8 of 8

Force msgbox to always appear at top of window stack

  1. #1
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Force msgbox to always appear at top of window stack

    In some of my vba projects often when a message box is displayed, if other applications are running etc, the message box is sometimes not at the front of the window stack.
    Is it possible to force the mesage box to always appear on top, rather than hidden ?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Force msgbox to always appear at top of window stack

    Time for Leith and some Windows API.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Force msgbox to always appear at top of window stack

    Hello Wotadude,

    The answer depends on the type of message box. If you are using a VBA UserForm as a custom message box then it quite easy. If it is a system generated message box, one you created with MsgBox, then it is a bit more involved. Let me know which type you are using.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: Force msgbox to always appear at top of window stack

    message box type is that i generate with msgbox

  5. #5
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: Force msgbox to always appear at top of window stack

    All experts on the subject are welcome to assist.

    Any ideas people ?
    Thanks

  6. #6
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Force msgbox to always appear at top of window stack

    Are you losing focus at open or do you need to BringWindowToTop after something else had focus? Can you provide example code or xls?

    Try:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-05-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Force msgbox to always appear at top of window stack

    Leith,
    I'd like to do the same using VBA. Can you show me how please?

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Force msgbox to always appear at top of window stack

    Grasbo,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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