So, I am a newbiew in IE Automation for VBA.I will try to be very specific about my question. Recently, I have been trying to login to a website and then select a month from a dropdown list. I am able to select an option from the dropdown. However, when I click on the search Button, Results appear not for the values which I selected using VBA, but for the values that were originally there on the webpage. Normally, if one goes to the website, he has to click on the dropdown and select the relevant period and then click on the search button. I also tried FireEvent "onchange", but that does not seem to have any effect. I am attaching the relevant part of the VBA and also the related HTML.
Please guide how can I select the period.
VBA code:
Set e = IE.document.getElementsByName("fin")(0)
e.Focus
e.selectedIndex = 1
e.FireEvent ("onchange")
HTML:
<select name="fin" class="form-control ng-pristine ng-not-empty ng-valid ng-valid-required ng-touched"
data-ng-model="finyr" data-ng-options="item.year for item in years"
value="item.year" data-ng-change="hidedata()" required="">
<option label="2019-20" value="object:143" selected="selected">2019-20</option>
<option label="2018-19" value="object:144">2018-19</option>
<option label="2017-18" value="object:145">2017-18</option>
<option label="2020-21" value="object:146">2020-21</option></select>