I posted a similar message to this not long ago, but I didn't receive any responses. I hoped by restating my problem and giving more detail, somebody might have an idea.
Currently I have a list in excel that I want to populate in an Internet Explorer Form. I have already coded into my macro the ability to open internet explorer, logon to the website where the form is located. Once on the website, I need to click a link that opens a new browser window where the form is. Unfortumately my internet explorer object still references the other open window that contains the link that opens the browser form. How do I create a new Internet Explorer object that will reference the pop up object browser. Here is a snippet of my code to date:
Code:'Variable declarations Dim myIE As New InternetExplorer 'New ' Dim myURL As String Dim myDoc As HTMLDocument myURL = "https://..." myIE.navigate myURL myIE.Visible = True Do While myIE.Busy Or myIE.readyState <> READYSTATE_COMPLETE DoEvents Loop Set myDoc = myIE.document myDoc.forms(1).loginid.Value = userName myDoc.forms(1).password.Value = password myDoc.form1.submit Do While myIE.Busy Or myIE.readyState <> READYSTATE_COMPLETE DoEvents Loop 'Open End User Multiple Selection Set tags = myIE.document.getElementsByTagName("A") For Each tag In tags If InStr(1, tag, "'multiple_selections.htm','EndUser'", vbTextCompare) > 0 Then tag.Click Exit For End If Next
The problem happens after the last for loop because the variable "myIE" still references the old web page with the link that I just clicked to open the form. I need to now create an object that references that new form and I can't figure how to do it.
Thanks in advance for your help.