VBAlearner5
New Member
- Joined
- Jan 25, 2015
- Messages
- 4
Hi,
I am trying to use VBA to log into a website and then complete several actions.
So far I managed to log into the page, but I am unable to then click a button/link in a sub-menu.
I would be really grateful for any advice on how to execute the link in this sub-menu.
Thanks a lot!
My VBA code is:
Everything works fine until this part:
The relevant html code for the part that is not working is:
I am trying to use VBA to log into a website and then complete several actions.
So far I managed to log into the page, but I am unable to then click a button/link in a sub-menu.
I would be really grateful for any advice on how to execute the link in this sub-menu.
Thanks a lot!
My VBA code is:
Code:
Dim ie As Object
Dim x As Object
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate "https://www.intraship.de/intraship/jsp/SessionCtrl.jsp"
ie.Visible = True
Do While ie.Busy And Not ie.ReadyState = 4
DoEvents
Loop
DoEvents
ie.Document.all.Item("jTFName").Value = "XXX"
ie.Document.all.Item("jPFPassword").Value = "XXX"
Set x = ie.Document.getElementsByName("jBtnOK")
x(0).Click
Do While ie.Busy
Loop
ie.Document.getElementById("jBtnDispatchExpress").Click
ie.Document.getElementById("jBtnNewExpress").Click
Everything works fine until this part:
Code:
ie.Document.getElementById("jBtnDispatchExpress").Click
ie.Document.getElementById("jBtnNewExpress").Click
The relevant html code for the part that is not working is:
HTML:
<div class="row"> <div class="column_1"><img src="./images/pfeilrot1.gif"></div> <div class="column_2"> <a href="javascript:openSubMenu( 'Top', 'DispatchExpressSub' );highlight( 'Top', 'jBtnDispatchExpress', 'Main' );" class="hyperRef"> <span id="jBtnDispatchExpress" class="divButtonStyle">Versandabwicklung<br>Express</span> </a> </div> </div> <div class="row" id="DispatchExpressSub" style="display:none;"> <div class="column_1"> </div> <div class="column_2"> <div class="subRow"> <div class="subColumn_1""><img src="./images/pfeilrot1.gif"></div> <div class="subColumn_2"> <a href="HXEmLJLhp7+gftPawiAG+MRpBZ+7wUt_kidM02RsbuRmA3e4QkIK_0L7c_h22sCN08+z8LFiv9+aognMt7GJI5Uv3YvN5WvOgw+P1QnXDiNHwB2DBcG6BnwejPyMyzrXZTCWkdZif4oCLP6UCwVZog--.jsp?IS=1&jBtnNewExpress=1" class="hyperRef" *******="highlight2( 'Top', 'jBtnNewExpress', 'Main' );" target="Body"> <span id="jBtnNewExpress" class="subButtonStyle">Neuer Auftrag</span> </a> </div> </div>