shahin
Active Member
I've tried with a script to download an excel file from a webpage. To download that file, it requires a click on that file. I'm trying to get the first file from that page. However, when I run my script, It does click on that file but instead of "saving" or "opening" that file there is a pop up appears in the very bottom of that page giving three options: "Open","Save", and "Cancel". At this point I'm stuck. I can't inspect it using IE. IE lets me inspect all the other stuffs from that webpage other than what I mentioned. There is no such warning in chrome so I could not inspect it there as well.
This is my attempt so far:
This image below contains the pop up I was talking about:
This is my attempt so far:
Code:
Sub Download_File()
Dim HTML As HTMLDocument, post As Object
With CreateObject("InternetExplorer.Application")
.Visible = True
.navigate "https://www.ccee.org.br/portal/faces/pages_publico/o-que-fazemos/infomercado?_adf.ctrl-state=oi8fqj9jb_1&_afrLoop=401324887077895#!%40%40%3F_afrLoop%3D401324887077895%26_adf.ctrl-state%3Doi8fqj9jb_5"
While .Busy = True Or .readyState <> 4: DoEvents: Wend
Set HTML = .document
Do: Set post = HTML.getElementById("botaoDadosgerais"): DoEvents: Loop While post Is Nothing
post.Click
End With
End Sub
This image below contains the pop up I was talking about: