title: Checkbox on web page using Excel VBA
body: <p>I am trying to check a checkbox on a web page using Excel VBA. My code did not work. (There was no error but the tick was ticked) </p>
  
  <p>How can I make the tick show when I do it on the web page?</p>
  
  <p>Am I doing something wrong with the web scraping?</p>
  
  <hr>
  
  <p><strong>HTML:</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="slick-header ui-state-default"&gt;
    &lt;div class="slick-header-columns ui-sortable" style="left: -1000px;" unselectable="on"&gt;
      &lt;div title="Sélectionner / désélectionner tout" class="ui-state-default slick-header-column" id="slickgrid_951473vssGrid_rowSelect_123527" style="width: 21px;"&gt;
        &lt;div class="header"&gt;
          &lt;input type="checkbox"&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="ui-state-default slick-header-column" id="slickgrid_951473purchase_order" style="width: 104px;"&gt;
        &lt;div class="header slick-sort-header"&gt;&lt;span class="slick-column-name"&gt;Bon de commande&lt;/span&gt;&lt;/div&gt;&lt;span class="slick-sort-indicator"&gt;&lt;/span&gt;
        &lt;div class="slick-resizable-handle"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="ui-state-default slick-header-column" id="slickgrid_951473purchase_order_date" style="width: 104px;"&gt;
        &lt;div class="header slick-sort-header"&gt;&lt;span class="slick-column-name"&gt;Date de la commande&lt;/span&gt;&lt;/div&gt;&lt;span class="slick-sort-indicator slick-sort-indicator-asc"&gt;&lt;/span&gt;
        &lt;div class="slick-resizable-handle"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="ui-state-default slick-header-column" id="slickgrid_951473latest_ship_date" style="width: 103px;"&gt;
        &lt;div class="header slick-sort-header"&gt;&lt;span class="slick-column-name"&gt;Date d'expédition maximale&lt;/span&gt;&lt;/div&gt;&lt;span class="slick-sort-indicator"&gt;&lt;/span&gt;
        &lt;div class="slick-resizable-handle"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="ui-state-default slick-header-column" id="slickgrid_951473vendor_code" style="width: 103px;"&gt;
        &lt;div class="header slick-sort-header"&gt;&lt;span class="slick-column-name"&gt;Vendor code&lt;/span&gt;&lt;/div&gt;&lt;span class="slick-sort-indicator"&gt;&lt;/span&gt;
        &lt;div class="slick-resizable-handle"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="ui-state-default slick-header-column" id="slickgrid_951473payee_code" style="width: 103px;"&gt;
        &lt;div class="header slick-sort-header"&gt;&lt;span class="slick-column-name"&gt;Code bénéficiaire&lt;/span&gt;&lt;/div&gt;&lt;span class="slick-sort-indicator"&gt;&lt;/span&gt;
        &lt;div class="slick-resizable-handle"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="ui-state-default slick-header-column" id="slickgrid_951473warehouse_id" style="width: 103px;"&gt;
        &lt;div class="header slick-sort-header"&gt;&lt;span class="slick-column-name"&gt;Entrepôt de destination&lt;/span&gt;&lt;/div&gt;&lt;span class="slick-sort-indicator"&gt;&lt;/span&gt;
        &lt;div class="slick-resizable-handle"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="ui-state-default slick-header-column" id="slickgrid_951473currency_code" style="width: 103px;"&gt;
        &lt;div class="header slick-sort-header"&gt;&lt;span class="slick-column-name"&gt;Devise&lt;/span&gt;&lt;/div&gt;&lt;span class="slick-sort-indicator"&gt;&lt;/span&gt;
        &lt;div class="slick-resizable-handle"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="ui-state-default slick-header-column" id="slickgrid_951473status" style="width: 103px;"&gt;
        &lt;div class="header slick-sort-header"&gt;&lt;span class="slick-column-name"&gt;Statut&lt;/span&gt;&lt;/div&gt;&lt;span class="slick-sort-indicator"&gt;&lt;/span&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <hr>
  
  <p><strong>VBA code :</strong> </p>
  
  <pre><code>Sub automationAmazon()
      Dim ie As Object
      Set ie = CreateObject("internetexplorer.application")
      With ie
          .Visible = True
          .navigate "link"
  
          Do While .busy
              DoEvents
          Loop
  
          Do While .readyState &lt;&gt; 4
              DoEvents
          Loop
  
      End With
  
      Set Email = ie.document.getelementbyid("ap_email")
      Email.Value = "email@exemple.com"
  
      Set Password = ie.document.getelementbyid("ap_password")
      Password.Value = "xxx"
  
      Set submit = ie.document.getelementbyid("signInSubmit")
      submit.Click
  
      With ie
          .navigate "link"
          Do While .busy
              DoEvents
          Loop
  
          Do While .readyState &lt;&gt; 4
              DoEvents
          Loop
  
      End With
  
      ie.document.all("searchBy").Value = "PURCHASE_ORDER"
      ie.document.all("purchaseOrderNumber").Value = ThisWorkbook.Sheets("Data").Cells(1, 2).Text
      ie.document.getelementbyid("create-invoice-search-submit").Click
  
      Dim cBox As Object
      Set cBox = ie.document.getElementsByClassName("header")(0)
      cBox.Click
  End Sub
  </code></pre>
  
  <hr>
  
  <p>The HTML:</p>
  
  <p><a href="https://i.stack.imgur.com/rQJAW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rQJAW.png" alt="HTML"></a></p>
  
  <hr>