+ Reply to Thread
Results 1 to 2 of 2

Forcing items to background,foreground windows

  1. #1
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    132

    Forcing items to background,foreground windows

    Hello,

    I have a macro that utilizes an outside program, which I believe causes the main Excel window to lose "focus" as work is happening in between that other program and Excel. If I call a msgbox during this time, it works, but the focus does not switch back to Excel and pop up that msgbox - the user has to click on Excel (to see why the program stopped running, only to find a msgbox waiting for them.)

    I want that each time a msgbox initiates, it brings it to the forefront of what the user sees so they can action it accordingly.

    Here's the code, if it helps...

    Please Login or Register  to view this content.
    The issue here is that in the event the person did not supply a correct username or password, the system just sits there until they click BACK on Excel and see this msgbox. I'm trying to build this for a BIG group of people and I need it to be VERY clear when there's an error - so I need Excel and the msgbox prompt to come to the forefront of their view as soon as it hits, but I have no idea how to do this....

    thanks!

  2. #2
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Forcing items to background,foreground windows

    I figured it out

    By putting

    Please Login or Register  to view this content.
    before each msgbox, the window focuses back to Excel. Yay for me!

+ 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. Put userform in background and workbook in foreground
    By sebastienkanj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-10-2013, 09:05 AM
  2. Excel running in the background caused windows 7 to not log off/shut down
    By GavArm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2013, 06:50 AM
  3. Excel Pop Up windows all go to the Background
    By rich351854 in forum Excel General
    Replies: 2
    Last Post: 09-04-2012, 03:13 PM
  4. excel in the foreground
    By Jono2000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2005, 05:05 PM
  5. background-foreground color
    By Cenk Ursavas via OfficeKB.com in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 05-26-2005, 05:15 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