(Solved) – Downloading excel file from browser


Dashboard sample
Hi folks, trying to simulate a mouse click on a form on a browser to download report but failing.
i got stuck immediately when targeting the download link/image.
i also realize the form is using a post method to retrieve the file, so i’m not sure if just simulating a mouseclick on the link/image is sufficient. Thanks a bunch.

Sub TestDownload()
Dim elements As Object, element As Object, count As Long
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")

IE.Visible = True
IE.Navigate "https://something.com/Dashboard"

' Wait while IE loading...
    Do While IE.Busy
        Application.Wait DateAdd("s", 1, Now)

count = 0
Set elements = objIE.document.getElementsByTagName("a")

For Each element In elements
    If element.className = "ExportCurrentExtInt" Then
    End If

End Sub

** *--> the value appears when i click on the link to initiate the download* **

Leave a Reply

Your email address will not be published. Required fields are marked *

Export Current EXT-INT Interfaces  Export current EXT-INT Interfaces to Excel