+ Reply to Thread
Results 1 to 2 of 2

Excel VBA with IE - How to get the ID from a NEW OPEN IE window

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,067

    Excel VBA with IE - How to get the ID from a NEW OPEN IE window

    Hello,

    I'm stuck in trying to find an ID from a new open Internet Explorer Window.

    I know that the ID that I'm trying to search for is "rBeginMonth_BeginDate", but my code always says that it's empty.

    The code below is partially of what I've done.

    Public WithEvents ie As InternetExplorer
    Public WithEvents ieOption_submit As InternetExplorer
    Public ieTable As InternetExplorer
    
    Private Sub ie_NewWindow2(ppDisp As Object, Cancel As Boolean)
        Set ieOption_submit = New InternetExplorer
        Set ppDisp = ieOption_submit.Application
    End Sub
    
    Private Sub ieOption_submit_NewWindow2(ppDisp As Object, Cancel As Boolean)
        Set ieTable = New InternetExplorer
        Set ppDisp = ieTable.Application
    End Sub
    
    Sub ixReport_Download()
    Set ie = getNewIxReportWindow()
    Set frameNavigation = ie.document.frames("List")
    Set frameDetail = ie.document.frames("Detail")
    
    'Find and click "Monthly Operational Reports"
    strHttp = frameNavigation.document.body.innerHTML
    strId_Monthly_Operational_Reports = http_find_image_id_by_content("Monthly Operational Reports", strHttp)
    Set imgMonthly_Operational_Reports = frameNavigation.document.getElementById(strId_Monthly_Operational_Reports)
    imgMonthly_Operational_Reports.Click
    waitready ie
    
    'This is when a NEW IE Window Open after 'Monthly Operation Report' text was click
    'From here on, my 'str' and 'Set' are empty with the exception of strHttp.
    'I'm assuming that 'strHttp' is still on the 1st IE window, that's why it's not finding the ID that I want to find, i.e "rBeginMonth_BeginDate"
    strHttp = frameNavigation.document.body.innerHTML
    strId_rBeginMonth_BeginDate = http_find_dropdown_id_by_content("rBeginMonth_BeginDate", strHttp)
    Set iptBeginDate = frameNavigation.document.getElementById(strId_rBeginMonth_BeginDate)
    
    strId_rEndMonth_EndDate = http_find_dropdown_id_by_content("rEndMonth_EndDate", strHttp)
    Set iptEndDate = frameNavigation.document.getElementById(strId_rEndMonth_EndDate)
    
    Set imgSubmit = frameNavigation.document.getElementById("lgxReport")
    Last edited by dluhut; 04-22-2014 at 09:36 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,067

    Re: Excel VBA with IE - How to get the ID from a NEW OPEN IE window

    Anyone able to help?

+ 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. OPen excel file in already open Excel window
    By gokzee in forum Excel General
    Replies: 0
    Last Post: 02-01-2013, 03:55 AM
  2. How to automatically open excel in a new window?
    By JDobbsy1987 in forum Excel General
    Replies: 1
    Last Post: 02-08-2010, 04:49 AM
  3. Open excel in new window?
    By Hippogriff in forum Excel General
    Replies: 6
    Last Post: 11-14-2006, 11:33 AM
  4. excel open in new window
    By Peter in forum Excel General
    Replies: 4
    Last Post: 11-10-2005, 01:10 PM
  5. [SOLVED] Excel workbook does not open in open window on desktop
    By DeanH in forum Excel General
    Replies: 2
    Last Post: 03-08-2005, 06:06 AM

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