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) Loop count = 0 Set elements = objIE.document.getElementsByTagName("a") For Each element In elements If element.className = "ExportCurrentExtInt" Then element.Click End If Next End Sub