Hello!
I'm trying to use VBA to navigate to a webpage and download a file.
To get to the final download it has to set several parameters, including date.
My issue is that when VBA changes the text field to my desired date, the change does not stick. The textbox shows the date to be correct, but upon clicking on the text box it reverts to the previous date.
Here's what I have so far:
From the website:
My code:
I've tried setting startdate.Value to "Sep 01, 2014" as well, but neither stick on the website.
Thanks!
I'm trying to use VBA to navigate to a webpage and download a file.
To get to the final download it has to set several parameters, including date.
My issue is that when VBA changes the text field to my desired date, the change does not stick. The textbox shows the date to be correct, but upon clicking on the text box it reverts to the previous date.
Here's what I have so far:
From the website:
Code:
input type="text" value="Oct 01, 2014" id="ctl00_PageContent_dsStartDateFilter_dateInput_text" name="ctl00_PageContent_dsStartDateFilter_dateInput_text" class="riTextBox riEnabled" style="width:100%;" maxlength="524288">
My code:
Code:
Set ie = CreateObject("InternetExplorer.Application")
With ie
ie.Visible = True
ie.navigate "website.com"
Do While ie.busy
Application.StatusBar = "Downloading.."
DoEvents
Loop
ie.navigate "website.com/nextpage"
Do While ie.busy
Application.StatusBar = "Downloading.."
DoEvents
Loop
Set startdate = ie.document.getElementByID("ctl00_PageContent_dsStartDateFilter_dateInput_text")
startdate.Value = "9/1/2014"
Set submitbun = ie.document.getElementByID("PageContent_btnQuery")
submitbun.Click
I've tried setting startdate.Value to "Sep 01, 2014" as well, but neither stick on the website.
Thanks!
Last edited: