1

I'm facing an issue with one part of my code. Namely, situation where I am unable to select options from the "widget dropdown menu". I have tried calling the ID and classname with no success (no errors but also nothing is happening).

My VBA:

IE.document.getelementbyid("orgSelection").Focus
IE.document.getelementbyid("orgSelection").selectedindex = 2
IE.document.getelementbyid("orgSelection").FireEvent "onchange"

I have tried this (but also no luck):

IE.document.getelementbyid("orgSelection").Value = "Cats"

I have tried advice from here as well

Source code from IE:

<div class="ui-widget uiWidgetDiv">
<input class="onSubmitValue" id="onSubmitValue" type="hidden" value="selectedOrg">
<input class="statusValue_orgName" id="statusValue_orgName" type="hidden" value="">
<input name="selectedOrg" class="statusValue_orgID" id="statusValue_orgID" type="hidden" value="">
<select class="regular" id="orgSelection" style="display: none;">
<option value="">--Select--</option>

<option value="Cats">
Cats
</option>
<option value="dogs">
dogs
</option>

<option value="--ALL--.issuer">
--ALL--
</option>
<input class="regular ui-autocomplete-input ui-widget ui-widget-content ui-corner-left" style="width: 195px;" placeholder="--Select--" autocomplete="off"><button tabindex="-1" title="Enter minimum 3 characters or more to narrow search results. &#10; Only first 500 organizations displayed." class="ui-button ui-widget ui-button-icon-only ui-corner-right ui-button-icon" type="button"><span class="ui-button-icon ui-icon ui-icon-triangle-1-s"></span><span class="ui-button-icon-space"> </span>&nbsp;</button><input class="onlyAll" id="onlyAll" type="hidden" value="1">

Can you please advise?

PS. The "Cats" and "dogs" are held in a dropdown menu which is referred to (in web source code) as "ui widget" - not sure if that supports the approach?

Pierre Bonaparte
  • 623
  • 6
  • 17

1 Answers1

1

I have solved it:

'calling dropdown to open
IE.Document.GetElementsByClassName("ui-button ui-widget ui-button-icon-only ui-corner-right ui-button-icon")(0).Click

'selecting first option from the dropdown
IE.Document.GetElementsByClassName("ui-corner-all")(1).Click

There was no need to "execute" or send ~Enter to progress with the selection as the widget automatically uploaded data.

Pierre Bonaparte
  • 623
  • 6
  • 17