Internet Explorer Save file Popup

JamworkS

Registered User.
Local time
Today, 18:00
Joined
Sep 1, 2011
Messages
49
Help!! Internet Explorer Object + Save File Popup

Hiya guys!! I'm trying to create an automatic system that enters into a password protected site (HTTPS), and saves a file into a directory I've previously created.

I've done it all programatically, everything goes OK, I click into the button to retrieve the file (an XLS) and the File/Save dialog comes up and obviously the program won't continue until I do something with it.

I need to tell Internet Explorer to save it but I can't do it programatically, or at least I can't think of anything. I even tried with Sendkeys which I hate to use (I think it's like low tech programming) but it didn't do anything.

So, any ideas on how can I click the SAVE button in Internet Explorer? In fact, I don't even mind where it saves it, as far as it does, I can programatically move it afterwards to where I want it to be.

Thank you very much.
 
Last edited:
This is my code, just in case is of any help:

Code:
Function DOWNLOAD()
    
    Dim pEsTerrestres As Boolean: pEsTerrestres = True
    Dim IE As Object
        
    Set IE = CreateObject("InternetExplorer.Application")
    
    IE.navigate "https://www.URLhere.com"
   
    While IE.Busy
        DoEvents
    Wend
    
    IE.VISIBLE = True
    
    IE.navigate "javascript:__doPostBack('LnkUsuarioPw','')"
    Call EsperaCargaPágina(IE)
    Call EsperaCargaPágina(IE)
    Call EsperaCargaPágina(IE)

    If pEsTerrestres Then
        IE.navigate "javascript:__doPostBack('lnk_Terrestres','')"
    Else
        IE.navigate "javascript:__doPostBack('lnk_Embarcaciones','')"
    End If

    Call EsperaCargaPágina(IE)
    Call EsperaCargaPágina(IE)
    Call EsperaCargaPágina(IE)
    
    IE.Document.Forms(0).elements(4).Value = "XXXX"
    IE.Document.Forms(0).elements(5).Value = IIf(pEsTerrestres, "YYYY", "ZZZZ")
    
    IE.navigate "javascript:__doPostBack('lnk_aceptar','')"
    
    Call EsperaCargaPágina(IE)
    Call EsperaCargaPágina(IE)
    Call EsperaCargaPágina(IE)
    
    IE.navigate IE.Document.anchors(0)
    
    Call EsperaCargaPágina(IE)
    Call EsperaCargaPágina(IE)
    Call EsperaCargaPágina(IE)
    
    IE.navigate "javascript:__doPostBack('lnk_excel','')"
    
    Call EsperaCargaPágina(IE)
    Call EsperaCargaPágina(IE)
    Call EsperaCargaPágina(IE)
    
    IE.navigate "javascript:__doPostBack('lnk_excel','')"


    
End Function


The function EsperaCargaPágina(IE) just waits until IE is ready.

And IE.navigate "javascript:__doPostBack('lnk_excel','')" is the button that brings the popup button.
 
And this is the popup:

savepopup.png
 

Users who are viewing this thread

Back
Top Bottom