enter image description herei am trying to download an excel file(.xls) from a pop up in Internet explorer via vba code. Which has three options (Open / Save / Cancel). i know this question was asked by many i tried few and it didnt work. Could you guys help ? i am using IE 11 version. Below is my code :
CODE :
Sub Button1_Click()
Dim IE As Object
Set IE = New InternetExplorerMedium
With IE
.Visible = True
.Navigate
"http://home.tim.flextronics.com/timireptool/ItemTransfer/Default.aspx"
Do While .busy
DoEvents
Loop
Do While .readystate <> 4
DoEvents
Loop
End With
Set CPC = IE.document.getelementbyid("tbCPC")
CPC.Value = "ALC3"
Set ddlOwner = IE.document.getelementbyid("ddlOwner")
For i = 1 To ddlOwner.Options.Length
If ddlOwner.Options(i).Text = "Warehouse" Then
ddlOwner.selectedindex = i
Exit For
End If
Next i
Set butview = IE.document.getelementbyid("butView")
butview.Click
Do While IE.busy
DoEvents
Loop
Do While IE.readystate <> 4
DoEvents
Loop
Set butExcel = IE.document.getelementbyid("butExcel")
butExcel.Click
Do While IE.busy
DoEvents
Loop
<<WHERE I WANT TO DOWNLOAD FROM THE POP>>
End Sub
Suggest me a solution to OPEN/SAVE the file. Thanks.