title: Error Setting Document Element in VBA Code Referencing XML
body: <p>In a <a href="https://stackoverflow.com/questions/23568074/inserting-a-unique-id-in-specific-row-locations-for-multiple-ids">previous post</a> I was looking to find a way to manipulate XML, and an answer was provided by David that looked very promising.  However, I have been having a small issue when it comes to the following line: </p>
  
  <pre><code>Set Entity = DOM.DocumentElement.getElementsByTagName("EntityId")(0)
  </code></pre>
  
  <p>where by EntityId I actually meant entityId (to preserve continuity I have left the code as is).</p>
  
  <p>Namely I get the following error: Object variable / with block variable not set. </p>
  
  <p>Now, I found <a href="https://stackoverflow.com/questions/21413004/vba-pull-xml-data-to-excel">this post</a>, which outlined a potential solution, but I have the MSXML 6.0 reference box checked.  I have also confirmed, as that poster did, that the tag does exist in the XML document I am referencing.  Is there another reason this could be happening outside of user error?</p>
  
  <p>EDIT: Screenshot of entityId:</p>
  
  <p><img src="https://i.stack.imgur.com/O6uxF.png" alt="enter image description here"></p>