I've got a macro that I can use to log in to a website and authenticate myself, now I just need to add a section to click a button (which will download a .csv for me).
Here's the login code:
Sub WebLogin()
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.Navigate "www.MYSITE.com"
Do Until .ReadyState = 4
DoEvents
Loop
.document.all.Item("edit-name").Value = "MY EMAIL"
.document.all.Item("edit-pass").Value = "MY PASSWORD"
.document.forms(0).submit
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
End With
End Sub
So, that works fine. Once I'm logged in, here's the info for the button I'm trying to press:
<input name="_qf_GPDetail_submit_csv" value="Export to CSV" type="submit" id="_qf_GPDetail_submit_csv" class="form-submit">
If anyone could help me out with a bit of code to click this, that'd be amazing!
Try:
IE.document.all("_qf_GPDetail_submit_csv").Click
This is a pretty good tutorial on the basics of Internet Explorer Automation. It got me an initial start.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments