April 7, 2020
This is the html code for the button:
All the attachments should be downloaded to specific folder with Order number as a folder name. Order numbers are listed in Column A of the Sheet1 (based on Order number we ill search the results)
I found this piece of code...
Sub AANs()
Dim Dates As Object, Matters As Object, i As Long,
Ws As Worksheet
Dim L As Long
Lr As Long Dim Html As MSHTML.HTMLDocument
Lr1 = ThisWorkbook.Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
Dim ie As New InternetExplorer
'SETTING IE FOR Order NUMBERS
For L = 2 To Lr1
Set Ws = ActiveWorkbook.Sheets("Sheet2")
Set ie = New InternetExplorer ie.navigate www.abc.com/sc/wo/index?id=" & _ ThisWorkbook.Sheets("Sheet1").Range("A" & L)
ie.Visible = True Application.Wait Now + TimeValue("00:00:05")
Set Html = New MSHTML.HTMLDocument
Html.body.innerHTML = ie.document.querySelectorAll(".btn btn-default")
Set Dates = Html.querySelectorAll(".wo-attachments-link") < GOT stuck here
October 5, 2010
Hi Rajsha,
Never done this with VBA, I have to wonder why you are using Excel to do this? Doesn't seem the like the best tool.
You could try using Selenium https://www.myonlinetraininghu.....ng-forms
Then by clicking the download button the file will download.
Driver.FindElementById("download-button-ID").Click
You may need to set some preferences in Chrome to save without asking you to save the file.
If you were to use Python it would be easier.
Regards
Phil
April 7, 2020
1 Guest(s)