Results 1 to 9 of 9

How to put focus to IE

Threaded View

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    helsinki, finland
    MS-Off Ver
    Excel 2007
    Posts
    81

    How to put focus to IE

    Hi !

    I'm new to this forum and have a problem that I haven't been able to solve by searching around the internet.
    I need to put the focus to MS Internet Explorer but have not yet find the solution.
    It is quite easy to put focus to Excel like this:

    Sub setFocus() 
        Dim lExcelHwnd As Long
            lExcelHwnd = FindWindow("XLMAIN", Application.Caption)
            SetForegroundWindow lExcelHwnd 
            MsgBox "Excel is now on top"
    End Sub
    So what could you put instead of XLMAIN to bring the focus on IE,
    Where could one find a list of short names where also XLMAIN is a member?

    Have not been able to find anything that would function correctly and referring to IE,
    for example "'IEFrame" does not work and that is also the only thing I have found so far.

    In my case IE is open and there is not a need to open it, just to put the focus there.

    Thank you in advance
    keymuu
    Last edited by keymuu; 11-11-2012 at 09:46 AM. Reason: code tags

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