Hello I'm trying to automate the downloading part of my report automation. I was able to get the raw data and all via navigation but i'm now stuck in downloading it as my IE is older version. A pop out of "Open", "Save","Cancel". I can't post the website since it's a client web tool.
Commented part is what I've tried so far.
Sub Get_RawFile()
'
'
'
Dim IE As New InternetExplorer
Dim HTMLDoc As HTMLDocument
Dim HTMLselect As HTMLSelectElement
'Dim saveInFolder As String, saveAsFilename As String
'saveInFolder = "C:"
'saveAsFilename = "test_" & Format(Sheets("Attendance").Range("X6").Value, "yyyymmdd")
With IE
.Visible = True
.Navigate ("---------------------")
While IE.Busy Or IE.readyState <> 4: DoEvents: Wend
Set HTMLDoc = IE.document
HTMLDoc.all.UserName.Value = Sheets("Data Dump").Range("A1").Value
HTMLDoc.all.Password.Value = Sheets("Data Dump").Range("B1").Value
HTMLDoc.getElementById("login-btn").Click
While IE.Busy Or IE.readyState <> 4: DoEvents: Wend
Application.Wait (Now + TimeValue("0:00:05"))
Set objButton = HTMLDoc.getElementById("s2id_ddlReportType")
Set HTMLselect = HTMLDoc.getElementById("ddlReportType")
objButton.Focus
HTMLselect.Value = "2"
Set HTMLselectZone = HTMLDoc.getElementById("ddlTimezone")
HTMLselectZone.Value = "PST8PDT"
Set subgroups = HTMLDoc.getElementById("s2id_ddlSubgroups")
subgroups.Click
Set subgroups2 = HTMLDoc.getElementById("ddlSubgroups")
subgroups2.Value = "1456_17"
HTMLDoc.getElementById("dtStartDate").Value = Format(Sheets("Attendance").Range("B6").Value, "yyyy-mm-dd")
HTMLDoc.getElementById("dtEndDate").Value = Format(Sheets("Attendance").Range("X6").Value, "yyyy-mm-dd")
HTMLDoc.getElementById("btnGetReport").Focus
HTMLDoc.getElementById("btnGetReport").Click
Application.Wait (Now + TimeValue("0:00:10"))
HTMLDoc.getElementById("btnDowloadReport").Click 'Download report button
'saveInFolder, saveAsFilename
End With
End Sub