title: Web driver how to select option in DYNAMIC drop down in VBA
body: <p>I have this HTML</p>
  
  <pre><code>&lt;div class="ui-widget"&gt;
  &lt;select name="calAlum" style="display: none;"&gt;undefined
  &lt;option value=""&gt;&lt;/option&gt; 
  &lt;option value="5.0"&gt;5.0&lt;/option&gt;
   &lt;option value="5.1"&gt;5.1&lt;/option&gt; 
  &lt;option value="5.2"&gt;5.2&lt;/option&gt;
   &lt;option value="5.3"&gt;5.3&lt;/option&gt;
   &lt;option value="5.4"&gt;5.4&lt;/option&gt;
   &lt;option value="5.5"&gt;5.5&lt;/option&gt;
   &lt;option value="5.6"&gt;5.6&lt;/option&gt;
   &lt;option value="5.7"&gt;5.7&lt;/option&gt;
   &lt;option value="5.8"&gt;5.8&lt;/option&gt;
   &lt;option value="5.9"&gt;5.9&lt;/option&gt;
   &lt;option value="6.0"&gt;6.0&lt;/option&gt;
   &lt;option value="6.1"&gt;6.1&lt;/option&gt;
   &lt;option value="6.2"&gt;6.2&lt;/option&gt;
   &lt;option value="6.3"&gt;6.3&lt;/option&gt;
   &lt;option value="6.4"&gt;6.4&lt;/option&gt;
   &lt;option value="6.5"&gt;6.5&lt;/option&gt;
   &lt;option value="6.6"&gt;6.6&lt;/option&gt;
   &lt;option value="6.7"&gt;6.7&lt;/option&gt;
   &lt;option value="6.8"&gt;6.8&lt;/option&gt;
   &lt;option value="6.9"&gt;6.9&lt;/option&gt;
   &lt;option value="7.0"&gt;7.0&lt;/option&gt;
   &lt;option value="7.1"&gt;7.1&lt;/option&gt;
   &lt;option value="7.2"&gt;7.2&lt;/option&gt;
   &lt;option value="7.3"&gt;7.3&lt;/option&gt;
   &lt;option value="7.4"&gt;7.4&lt;/option&gt;
   &lt;option value="7.5"&gt;7.5&lt;/option&gt;
   &lt;option value="7.6"&gt;7.6&lt;/option&gt;
   &lt;option value="7.7"&gt;7.7&lt;/option&gt;
   &lt;option value="7.8"&gt;7.8&lt;/option&gt;
   &lt;option value="7.9"&gt;7.9&lt;/option&gt;
   &lt;option value="8.0"&gt;8.0&lt;/option&gt;
   &lt;option value="8.1"&gt;8.1&lt;/option&gt;
   &lt;option value="8.2"&gt;8.2&lt;/option&gt;
   &lt;option value="8.3"&gt;8.3&lt;/option&gt;
   &lt;option value="8.4"&gt;8.4&lt;/option&gt;
   &lt;option value="8.5"&gt;8.5&lt;/option&gt;
   &lt;option value="8.6"&gt;8.6&lt;/option&gt;
   &lt;option value="8.7"&gt;8.7&lt;/option&gt;
   &lt;option value="8.8"&gt;8.8&lt;/option&gt;
   &lt;option value="8.9"&gt;8.9&lt;/option&gt;
   &lt;option value="9.0"&gt;9.0&lt;/option&gt;
   &lt;option value="9.1"&gt;9.1&lt;/option&gt;
   &lt;option value="9.2"&gt;9.2&lt;/option&gt;
   &lt;option value="9.3"&gt;9.3&lt;/option&gt;
   &lt;option value="9.4"&gt;9.4&lt;/option&gt;
   &lt;option value="9.5"&gt;9.5&lt;/option&gt;
   &lt;option value="9.6"&gt;9.6&lt;/option&gt;
   &lt;option value="9.7"&gt;9.7&lt;/option&gt;
   &lt;option value="9.8"&gt;9.8&lt;/option&gt;
   &lt;option value="9.9"&gt;9.9&lt;/option&gt;
   &lt;option value="10.0"&gt;10.0&lt;/option&gt;
   &lt;/select&gt;
  </code></pre>
  
  <p>when i click on the objetc display all the list but if a press "5" for example the list show only "5.0", "5.1" ,"5.2" etc. and when i press 5.8 only show me "5.8" llike valu to select</p>
  
  <p>So i want to select any option with VBA, (whith other combox i dont have problems but with this have error)</p>
  
  <p>i have tried this</p>
  
  <pre><code>sub CALF()
  
  Dim H As selenium.Keys
  
  *Here  find the element "select" whit the name "calAlum"* i dont have problem
  
  For Each element In WEB3.FindElementsByTag("select")
  
  If element.Attribute("name") = "calAlum" Then
  
   element.AsSelect.selectbyvalue Activecell *in this part show error*
  
  End If
  
  Next
  
  MsgBox "fin"
  
  End Sub
  </code></pre>
  
  <p>but for this drop down doesnt work i tried to use diferent ways but dont work, NOTE: this code go to inside IF</p>
  
  <p>"to focus the box but dont work"</p>
  
  <pre><code>element.click 
  </code></pre>
  
  <p>"to write value dont work"</p>
  
  <pre><code>element.sendkeys "5.8"
  </code></pre>
  
  <p>"to copy value in clipboard then paste value in the objetc dont work"</p>
  
  <pre><code>WEB3.SetClipBoard ActiveCell.Value
  element.SendKeys Control, "V"
  </code></pre>
  
  <p>but if manually select any value in the object like "9.8" and the in the code use</p>
  
  <pre><code>R= element.value
  </code></pre>
  
  <p>or</p>
  
  <pre><code>R=elment.attrribute("value")
  </code></pre>
  
  <p>return "9.8" then i use</p>
  
  <pre><code>element.asselect.selectbyvalue R  work
  </code></pre>
  
  <p>but if i change R= "9.7" and use</p>
  
  <pre><code>element.asselect.selectbyvalue R
  </code></pre>
  
  <p>return Error value no found</p>
  
  <p>then i tried after to wrap webelement in selectelemnet this</p>
  
  <pre><code>r= element.SelectedOption
  
  r= element.asselect.selectedoption
  </code></pre>
  
  <p>to know what option is selected, but both return void "" obviusly is rare because  R= element.value return "9.8" then i use </p>
  
  <pre><code>element.asselect.options
  
  for i=0 to element.asselect.options
  
  r(i)=element.asselect.selectedoption
  
  next
  </code></pre>
  
  <p>to know all option are in selectelement "element"  but return error its necesary a object so use</p>
  
  <pre><code>r = element.IsSelected
  </code></pre>
  
  <p>but return false thats to say i cant use the object like webelement and if i wrap to selectelment the object dont have any option, someone can help me.</p>
  
  <p>If you help me how to select the object o how to manipulate object "select" dynamic</p>