Re: Get URL from intranet link name...need help.
Hello...hope you guys was having a great weekend....any update about this topic guys? thanks
Re: Get URL from intranet link name...need help.
Hello...hope you guys was having a great weekend....any update about this topic guys? thanks
Re: Get URL from intranet link name...need help.
Quote from mrmmickle1;771493Did the msgbox appear when you ran the first code snippet?
Nope...it only open the intranet then nothing happen next.
Re: Get URL from intranet link name...need help.
Hello mrmmickle1...thanks a lot for the continual support...really owe you this if we can solve...i tried the code you recommended but it only open the intranet site and then do nothing....second code also got the same result...so i am sharing you the html code as per request, hope it can help...thanks a lot in advance.
The flow is like this actually, every end of the month we open the intranet site and then click the download link of the over time form. The download link name is "OT Claim Form (May 2016 Payroll)" and keep changing the link name depends on the month. But let me handle on the changing names...The only think i need is how the vba excel code to automatic open the intranet and click the download link name...thanks
<tr class="fliesstext " valign="top" bgcolor="#ffffff"><td width="5%" valign="top" style="vertical-align:top"></td>
<td valign="top" style="width:412px;vertical-align:top"><div><a href="/location/place/place/20Form/OT_May_16.xls" target="_blank">OT Claim Form (May 2016 Payroll)</a></div></td></tr>
<tr class="fliesstext " valign="top" bgcolor="#eeeeee"><td width="5%" valign="top" style="vertical-align:top"><span></span><span></span></td>
Re: Get URL from intranet link name...need help.
Hello... looks not working...it only open the site and do nothing,...really thankful for your continual support and understanding a newbie like me. Below is my code....pls help me check what went wrong...thanks
Sub Button1_Click()
Dim ie As InternetExplorer
Dim html As HTMLDocument
Dim Link As Object
Dim ElementCol As Object
Dim mySingleLink As Object
Dim myLinks As Object
Dim myClickLink As Object
Application.ScreenUpdating = False
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "MyURL/Pages/default.aspx"
On Error Resume Next
Do While ie.ReadyState <> READYSTATE_COMPLETE
Application.StatusBar = "Loading website..."
DoEvents
Loop
Set html = ie.document
Set myLinks = ie.document.getElementsByTagName("a")
For Each mySingleLink In myLinks
If mySingleLink.innerText = "OT Claim Form (May 2016 Payroll)" Then
Set myClickLink = mySingleLink.ChildNodes.Item(0)
myClickLink.Click
End If
Next
Set ie = Nothing
Application.StatusBar = ""
Application.ScreenUpdating = True
End Sub
Display More
The image below is the link name i want to click using vba....thanks a lot.
[ATTACH=CONFIG]69218[/ATTACH]
Re: BA code to open a site (intranet) and look for the link name (MyLink) and click.
My apology for the duplication...because i am thinking that i never explain well my previous post i decided to submit with more clear info.
But it should be fine for me if the admin will delete this and i go back to my previous post and continue...thanks
Re: BA code to open a site (intranet) and look for the link name (MyLink) and click.
Is my post been publish? Sorry i am a beginner.
Hello Team...so below is my code...I cant get it to work...please help...thanks.
Sub Button1_Click()
Dim internet As Object
Dim internetdata As Object
Dim div_result As Object
Dim header_links As Object
Dim link As Object
Dim URL As String
Set internet = CreateObject("InternetExplorer.Application")
internet.Visible = True
URL = "http://web.myweb.com/location/myplace/en-US/OnD/RH/RH%20Form/Pages/default.aspx"
internet.Navigate URL
While internet.ReadyState >= 4
DoEvents
Wend
Application.Wait Now + TimeSerial(0, 0, 5)
Set link = ie.document.getElementsByTagName("a")
For Each h In header_links
If h.innerText = "MyLink" Then
Set link = h.ChildNodes.Item(0)
link.Click
End If
Next
End Sub
Display More
Re: Get URL from intranet link name...need help.
Done....thanks...please help : -)
Re: Get URL from intranet link name...need help.
Hello it is not the one i want actually...maybe I want to simplify my question....please help me fix my VBA code to look for "MyLink" link name from the site (intranet)....and then click it ...My code is below but cant make it to work....Please help...
Sub Button1_Click()
Dim internet As Object
Dim internetdata As Object
Dim div_result As Object
Dim header_links As Object
Dim link As Object
Dim URL As String
Set internet = CreateObject("InternetExplorer.Application")
internet.Visible = True
URL = "http://web.myweb.com/location/myplace/en-US/OnD/RH/RH%20Form/Pages/default.aspx"
internet.Navigate URL
While internet.ReadyState >= 4
DoEvents
Wend
Application.Wait Now + TimeSerial(0, 0, 5)
Set link = ie.document.getElementsByTagName("a")
For Each h In header_links
If h.innerText = "MyLink" Then
Set link = h.ChildNodes.Item(0)
link.Click
End If
Next
End Sub
Display More
Re: Get URL from intranet link name...need help.
Last call for help [Blocked Image: http://www.mrexcel.com/forum/images/smilies/icon_frown.gif]
Re: Get URL from intranet link name...need help.
Anyone here can help me? This forum suppose to be active.
3 days ago from now i has been searching answers but still cant find it. Looking forwards this forum can help me...every month we downloaded over-time form from intranet by clicking a link...So i want to make a vba to get the URL from one of the link name in site. The attach image is the example...i want to get the URL encirled in red and paste into excel (filename otform.xlsm cell A1)..really need help...thanks
[ATTACH=CONFIG]69100[/ATTACH]