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 HtmlElement
e.g.
Dim myHtmlEl As HtmlElement
Returns the error "User defined type not defined."
I have seen this problem before when I wanted to declare and instance of an InternetExplorer
object. The solution to that was to create reference by Tools >> References... >> Microsoft Internet Controls in the VBA editor. My understanding is that Microsoft Internet Controls is a .dll
with a definition of the InternetExplorer
class.
Therefore to create an instance of an HtmlElement
object I need to reference the .dll
that defines that class. MSDN suggests that the .dll
is System Windows Forms. I linked that but the class is still undefined.
How do I know which .dll contains HtmlElement
class?
Dim myHtmlEl As Object
. – Mike