Hi all,
I'm trying to automate the downloading of files from a list in excel.
Things were going smoothly until I came across 2 elements with the same ElementID
here is what I have so far:
Sub getmedia()
Dim ie As New InternetExplorer
Dim url As String
Dim x As Integer
x = 2
url = "some url" & Cells(x, 1).Value
While Cells(x, 1) <> ""
ie.Visible = True
ie.Navigate (url)
ie.Document.getElementsByID("button1").Click
x = x + 1
Wend
End Sub
"ie.Document.getElementsByID("button1").Click" works. However, this clicks a different button than the one intended. The 2 buttons have the following element ID information:
<button type="button" value="Back" id="button1" name="button1">Back</button>
<button type="submit" value="Submit" id="button1" name="submit">Zip Selected</button>
Im trying to get the "zip selected" button (Blue) but its clicking the "back" button (red).
Can anyone tell me how I can click the "zip selected" button with vba?
Bookmarks