title: VBA and Aria HTML Control
body: <p>I have a seemingly simple but aggravating question. I am writing VBA code to control a slider bar on a webpage. This should be straightforward process like filling various types of check boxes and input boxes but I am running into a coding error. The slider bar has a high and low value that I would like to set (denoted by Price).</p>
  
  <p>Here is my code...</p>
  
  <pre><code>Function Master
  Dim Elem As Object      ' Object used in For loop.
  Dim e As Object         ' Object used in For loop.
  Dim Element As Object   ' Object used to click buttons for search.
  
  Dim PriceLow As Integer
  Dim PriceHigh As Integer
  
  Set objShell = CreateObject("Shell.Application")
  Set objWindow = objShell.Windows()
  Set Elem = objIEApp.Document.getElementsByTagName("div")
  For Each e In Elem
      If e.role = "slider" And e.tabindex = 1 Then
          e.aria-valuenow = Pricelow
      ElseIf e.role = "slider" And e.tabindex = 2 Then
          e.aria-valuenow = Pricehigh
      End If
  Next e
  End Function
  </code></pre>
  
  <p>This is the HTML code for the low Price (without the &lt;> brackets)</p>
  
  <pre><code>div
      tabindex="1" class="airslide-handle" role="slider" aria-valuenow="10"
      aria-valuemin="10" aria-valuemax="1000" style="left: 0%;" 
      data-reactid=".4.1.1:$0" abp="340" data-handle-key="0"&gt;
  /div
  </code></pre>
  
  <p>And for the high Price (same with &lt;>)</p>
  
  <pre><code>div tabindex="2" class="airslide-handle" role="slider" aria-valuenow="1000" 
      aria-valuemin="10" aria-valuemax="1000" style="left: 100%;"
      data-reactid=".4.1.1:$1" abp="341" data-handle-key="1"&gt;
  /div
  </code></pre>
  
  <p>When I type in the code lines "e.aria-valuenow = Pricehigh" and "e.aria-valuenow = Pricelow" though, VBA auto edits to make my code "e. Aria - valuenow = Pricehigh" and "e.Aria - valuenow = Pricelow" which obviously causes a compiling error in VBA. How do I fix or get around this?</p>