Cannot download file from Internet Explorer 11 dialog box

Hi,

I have created a code which will login in a website and when it click on export to download a file, IE displays a dialog box stating open,save and save as button inspite of several attempts my code doesnot clicks on save button,following is my code:

Sub Save_Over_Existing_Click_Yes()
    
    Dim hwnd As Long
    Dim timeout As Date
    
    Debug.Print “Save_Over_Existing_Click_Yes”
        
    ‘Find the Download  complete window, waiting a maximum of 30 seconds for it to appear.  Timeout value is dependent on the
    ‘size of the download, so make it longer for bigger files
    
    timeout = Now + TimeValue(“00:00:40”)
    Do
        hwnd = FindWindow(“#32770”, “Internet Explorer”)
        MsgBox hwnd
        DoEvents
        Sleep 200
    Loop Until hwnd Or Now > timeout
   ‘ Debug.Print ”   Save As window “; Hex(hwnd)
       
    If hwnd Then
        ‘Find the child Close button
         hwnd = FindWindowEx(hwnd, ByVal 0&, “Button”, vbNullString)
        
        ‘hwnd = FindWindowEx(hwnd, 0, “Button”, “&Save”)
       ‘ Debug.Print ”   save button “; Hex(hwnd)
    End If
    MsgBox hwnd
    If hwnd Then
    
        ‘Click the Close button
        MsgBox 1
        SetForegroundWindow (hwnd)
        Sleep 6000  ‘this sleep is required and 600 miiliseconds seems to be the minimum that works
        Const BM_CLICK As Long = &HF5&
        SendMessage hwnd, BM_CLICK, 0, 0
    End If
End Sub

By: Ramandeep Singh

126 thoughts on “Cannot download file from Internet Explorer 11 dialog box

  1. Sibutramine kaufen

    Superb blog you have here but I was curious if you knew of any discussion boards that cover the same topics discussed in this article? I’d really like to be a part of community where I can get feedback from other knowledgeable individuals that share the same interest. If you have any recommendations, please let me know. Many thanks!

  2. dekorasi rumah kayu

    Please let me understand if you’re trying to find a great author for your internet site. You could have some great content, and I think We would be a good advantage. If you happen to want to consider some of the weight off, I’d like in order to write some material intended for your blog in swap to get a link back in order to mine. Please shoot us an email if curious. Thanks.

  3. hgh for sale online

    I’m really enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Great work!

  4. Buy Reductil online

    Hi there, just was aware of your blog through Google, and located that it’s really informative. I’m gonna watch out for brussels. I will be grateful for those who continue this in future. Numerous folks will likely be benefited from your writing. Cheers!

  5. Comprar Fentermina en línea

    Hello there, just changed into alert to your blog thru Google, and located that it’s really informative. I am going to watch out for brussels. I will appreciate when you proceed this in future. Many other people will be benefited from your writing. Cheers!

  6. Acheter Melanotan 2 en ligne

    Hmm it looks like your blog ate my first comment (it was extremely long) so I guess I’ll just sum it up what I wrote and say, I’m thoroughly enjoying your blog. I as well am an aspiring blog blogger but I’m still new to everything. Do you have any helpful hints for first-time blog writers? I’d really appreciate it.

  7. produksicetak

    I have in order to voice my passion with regard to your kindness giving help to those people of which really should have guidance on this specific important matter.

  8. ephedrin kaufen

    Hey just wanted to give you a quick heads up. The text in your article seem to be running off the screen in Ie. I’m not sure if this is a formatting issue or something to do with internet browser compatibility but I figured I’d post to let you know. The design look great though! Hope you get the problem resolved soon. Kudos

Comments are closed.