1
I’m trying to use a getElementsByClassName in an Access macro.
You are showing line error:
If ie.Document.GetElementsByClassName("msgErroAdic").Length > 1 Then
Being Dim ie as Object
and Set ie = CreateObject("InternetExplorer.Application")
Returns the error that cannot locate the method.
I found this site: https://msdn.microsoft.com/en-us/library/ms535862%28v=vs.85%29.aspx#methods
There is no Getelementsbyclassname method in the Internetexplorer object.
However, on this other site: https://msdn.microsoft.com/en-us/library/hh773165%28v=vs.85%29.aspx there is the Getelementsbyclassname method.
I’d like to know the difference.
I also saw other questions where they indicate creating a function, but also did not work. Public Function GetElementsByClassName(Source As HtmlDocument, ClassName As String) As HtmlElement()
Build error: "User-defined type not defined".
Try to define
ie
asvariant
and then create the object withCreateObject("InternetExplorer.Application")
. See if it helps and let me know.– PedroMVM
Yeah, I forgot that part, it’s already like this.
– Felicio
@Pedromvm I tried to define as
Variant
, but it didn’t work either.– Felicio