title: Uncheck a checkbox in IE
body: <p>I am trying to uncheck an already checked checkbox on a webpage using excel VBA.</p>
  
  <p>HTML code:</p>
  
  <pre><code>&lt;div class="mycheckbox checked"&gt;
  &lt;label class="mycheckbox1 checked" data-initialize="checkbox"&gt;
      &lt;input name=&lt;name&gt; class=&lt;class&gt; id=&lt;id&gt; type="checkbox" checked="checked"&gt;&lt;/input&gt;&lt;/label&gt;&lt;/div&gt;
  </code></pre>
  
  <p>VBA code stub:</p>
  
  <pre><code>    Public Sub uncheck(IE As Object)
      Dim Element As Object
          With IE.Document
              Set Element = .getElementById(&lt;id&gt;)
              Element.Checked = False
              Element.defaultChecked = False        
          End With
      End Sub
  </code></pre>
  
  <p>This does not work out as desired as HTML code changes to -</p>
  
  <pre><code>&lt;div class="mycheckbox checked"&gt;
  &lt;label class="mycheckbox1 checked" data-initialize="checkbox"&gt;
      &lt;input name=&lt;name&gt; class=&lt;class&gt; id=&lt;id&gt; type="checkbox" checked=""&gt;&lt;/input&gt;&lt;/label&gt;&lt;/div&gt;
  </code></pre>
  
  <p>The checkbox is not unchecked as there is still the checked attribute</p>
  
  <p>Even tried the below(Clicking on the checkbox). It does not do anything at all -</p>
  
  <pre><code>    Public Sub uncheck(IE As Object)
      Dim Element As Object
          With IE.Document
              Set Element = .getElementById(&lt;id&gt;)
              Element.Click
          End With
      End Sub
  </code></pre>
  
  <p>Any suggestions? Or may I know why my approach not working?</p>