Hey all,
I'm trying to automate the running of a report. So far, I'm able to navigate to the report page and login, but I am stuck on how to enter data into the form to create the parameters of the report (other than by using SendKeys, which seems ineffective)
Here is my code so far:
Dim HTMLDoc As HTMLDocument
Dim MyBrowser As InternetExplorer
Sub Login2()
Dim MyHTML_Element As IHTMLElement
Dim MyURL As String
MyURL = "https://mc.s7.exacttarget.com/cloud/#app/Email/Content/Tracking/SubscriberReports/AsyncReportCreate.aspx?r=/ExactTarget/Tracking Reports/Recent Email Sending Summary&HistoryNodeID=REPORT_HISTORY"
MyUsername = "*************"
MyPassword = "*************"
Set MyBrowser = New InternetExplorer
MyBrowser.Silent = True
MyBrowser.Top = 0
MyBrowser.Left = 0
MyBrowser.AddressBar = 0
MyBrowser.StatusBar = 0
MyBrowser.Toolbar = 0
MyBrowser.Visible = True
MyBrowser.Navigate MyURL
Do
Loop Until MyBrowser.ReadyState = 4
Set HTMLDoc = MyBrowser.document
HTMLDoc.all.UserName.Value = MyUsername
HTMLDoc.all.Password.Value = MyPassword
For Each MyHTML_Element In HTMLDoc.getElementsByTagName("input")
If MyHTML_Element.Type = "submit" Then MyHTML_Element.Click: Exit For
Next
Do
Loop Until MyBrowser.ReadyState = 4
HTMLDoc.getElementsById("ReportParameterPicker1_rp_StartDate_picker").Value = "2014.01.01.0.0.0"
End Sub
I get the Run-time error '438: Object doesn't support this property of method.
Screenshot of the report form:
https://gyazo.com/db1a5e7d74bc836e771b7915d33f5abd
Ideally, I'd like to scroll through the form, filling out input areas with data populated on my Excel sheet.
Another issue I faced when trying to do this, is the program trying to take actions before the webpage had loaded fully, even though I have the "ReadyState" part in there.
Any help would be greatly appreciated!
Thanks!
Bookmarks