0

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.

Community
  • 1
  • 1
Jagadish
  • 1
  • 3
  • Possible duplicate of [Controlling IE11 "Do you want to Open/Save" dialogue window buttons in VBA](https://stackoverflow.com/questions/32145437/controlling-ie11-do-you-want-to-open-save-dialogue-window-buttons-in-vba) – Vityata Feb 08 '18 at 09:52
  • i couldnt implement it to my code. could you help ? – Jagadish Feb 08 '18 at 10:59

0 Answers0