-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
  • 10,905
  • 5
  • 18
  • 32
jedu
  • 1,067
  • 2
  • 16
  • 44

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
  • 81
  • 2