I am very green to VBA. I learned online by reading through forums and watching YouTube. So please be descriptive in your response. Or just respond bc I need help lol
So I am using code below to navigate to a company site and logging on. This works fine and takes me to homepage. Now I am stuck. I need to open/click on a hypertext link. Technically I need to click hypertext (id=Link0) which drops down another hypertext (id=Link0_0) which I need to click to open a new window. IDK if it is framing, *******, or some other function, but I am unable to use .Click, .getElementsByTagName to open hypertext. There are several hypertext options formatted on the left-hand side of the screen and are scripted as parent and child nodes. Please advise on the simplest code to achieve this. Below is the website code that has the hypertext element I need to open.
<DIV class=mainMenuCont><DIV id=node0 class=mainMenuTopNode>
<TABLE>
<TBODY>
<TR>
<TD vAlign=top><IMG style="HEIGHT: 20px; WIDTH: 20px" src="/images/themes/themesswanblue/default.png"></TD>
<TD><SPAN class=mainMenuNode1></SPAN><A *******="openMenuNode('0');return false" id=Link0 href="#" name=0>General Cargo</A></TD></TR></TBODY></TABLE></DIV>
<DIV id=nodeChild0 class=mainMenuChildCont style="DISPLAY: none; VISIBILITY: hidden">
<DIV id=node0_0 class=mainMenuChildNode>
<DIV class=mainMenuNode2><A id=Link0_0 href="/GC3/glog.webserver.finder.FinderServlet?ct=1800184983&query_name=glog.server.query.order.OrderReleaseQuery&finder_set_gid=NAM.GC_US_PPS_REQ_SUBMITTED" name=Link0_0 target=mainBody>Create New Request</A></DIV>
<DIV id=nodeChild0_0 class=mainMenuChildCont style="DISPLAY: none; VISIBILITY: hidden"></DIV></DIV></DIV>
_________________________________
Sub TMSconnect()
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
With ie
.Visible = True
.navigate "https://tms.nam.slb.com/GC3/jsp/login.jsp"
Do
DoEvents
Loop Until ie.readyState = 4
ie.document.getElementById("username").Value = "xxxxx"
ie.document.getElementById("userpassword").Value = "yyyyyy"
ie.document.getElementById("Submit").Click
Do
DoEvents
Loop Until ie.readyState = 4
End With
So I am using code below to navigate to a company site and logging on. This works fine and takes me to homepage. Now I am stuck. I need to open/click on a hypertext link. Technically I need to click hypertext (id=Link0) which drops down another hypertext (id=Link0_0) which I need to click to open a new window. IDK if it is framing, *******, or some other function, but I am unable to use .Click, .getElementsByTagName to open hypertext. There are several hypertext options formatted on the left-hand side of the screen and are scripted as parent and child nodes. Please advise on the simplest code to achieve this. Below is the website code that has the hypertext element I need to open.
<DIV class=mainMenuCont><DIV id=node0 class=mainMenuTopNode>
<TABLE>
<TBODY>
<TR>
<TD vAlign=top><IMG style="HEIGHT: 20px; WIDTH: 20px" src="/images/themes/themesswanblue/default.png"></TD>
<TD><SPAN class=mainMenuNode1></SPAN><A *******="openMenuNode('0');return false" id=Link0 href="#" name=0>General Cargo</A></TD></TR></TBODY></TABLE></DIV>
<DIV id=nodeChild0 class=mainMenuChildCont style="DISPLAY: none; VISIBILITY: hidden">
<DIV id=node0_0 class=mainMenuChildNode>
<DIV class=mainMenuNode2><A id=Link0_0 href="/GC3/glog.webserver.finder.FinderServlet?ct=1800184983&query_name=glog.server.query.order.OrderReleaseQuery&finder_set_gid=NAM.GC_US_PPS_REQ_SUBMITTED" name=Link0_0 target=mainBody>Create New Request</A></DIV>
<DIV id=nodeChild0_0 class=mainMenuChildCont style="DISPLAY: none; VISIBILITY: hidden"></DIV></DIV></DIV>
_________________________________
Sub TMSconnect()
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
With ie
.Visible = True
.navigate "https://tms.nam.slb.com/GC3/jsp/login.jsp"
Do
DoEvents
Loop Until ie.readyState = 4
ie.document.getElementById("username").Value = "xxxxx"
ie.document.getElementById("userpassword").Value = "yyyyyy"
ie.document.getElementById("Submit").Click
Do
DoEvents
Loop Until ie.readyState = 4
End With