title: Which .dll contains HTMLElement Class?
body: <p>I am using VBA from Excel (Office 2010) to navigate through a webpage in Internet Explorer.  My problem is I cannot declare an instance of an <code>HtmlElement</code> e.g.</p>
  
  <pre><code>Dim myHtmlEl As HtmlElement
  </code></pre>
  
  <p>Returns the error "User defined type not defined."</p>
  
  <p>I have seen this problem before when I wanted to declare and instance of an <code>InternetExplorer</code> object.  The solution to that was to create reference by <strong>Tools >> References... >> Microsoft Internet Controls</strong> in the VBA editor. My understanding is that <em>Microsoft Internet Controls</em> is a <code>.dll</code> with a definition of the <code>InternetExplorer</code> class.</p>
  
  <p>Therefore to create an instance of an <code>HtmlElement</code> object I need to reference the <code>.dll</code> that defines that class. <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.htmlelement%28v=vs.110%29.aspx" rel="nofollow">MSDN</a> suggests that the <code>.dll</code> is <em>System Windows Forms</em>. I linked that but the class is still undefined.</p>
  
  <p>How do I know which .dll contains <code>HtmlElement</code> class?</p>