-1

I get the above error when I try and select element by classname in vba.

 Dim ie As Object
 Set ie = CreateObject("InternetExplorer.Application") 
 Dim url As String
 url="https://sdsds.com"
 ie.Visible = True
 ie.navigate url

 Set objTables = ie.Document.getElementsByTagName("table")
 Set datatables = objTables(8)
 Set wb = ie.Document.getElementsByClassName("wb")(0)

Strange thing is that getElementsByTagName("table") works fine. But getElementsByClassName throws this error. I am not sure why.

braX
  • 11,506
  • 5
  • 20
  • 33
jedu
  • 1,211
  • 2
  • 25
  • 57

1 Answers1

0

Depending on the version of IE, you may not have that method available to you.

There is a site that I like to use to see what is and is not available in different browsers: https://caniuse.com/#search=Getelementsbyclassname

eotfofiw
  • 101
  • 2