0

The following is the error number & description that I'm getting:

"Run-time error 2147417848 (80010108) automation error the object invoked has discontinued from its client"

The line of code that is highlighted when I debug is:

 .Do Until internet.readyState >= 4

Code :

Sub webpage()

Dim internet As Object
Dim internetdata As Object
Dim div_result As Object
Dim header_links As Object
Dim link As Object
Dim URL As String

Set internet = CreateObject("InternetExplorer.Application")
internet.Visible = True

URL = "https://cs.apps.ca.com/otcs/cs.exe? 
func=Projects.ProjectOutline&objid=189982686&ItemType_136="
internet.navigate URL

Do Until internet.readyState >= 4
  DoEvents
  Loop

Application.Wait Now + TimeSerial(0, 0, 5)

Set internetdata = internet.document
Set div_result = internetdata.getElementById("res")


Set header_links = div_result.getElementsByTagName("h3")

For Each h In header_links
Set link = h.ChildNodes.Item(0)
Cells(Range("A" & Rows.count).End(xlUp).Row + 1, 1) = link.href
    Next

MsgBox "done"
End Sub

Please help on this

  • As a side note: I used to do this in order to connect VBA to a web browser, but since Internet Explorer is being deprecated and likely uninstalled, I switched to [selenium](https://www.guru99.com/excel-vba-selenium.html). I know that sometimes because of red tapes at enterprises it may be impossible to implement but if this is the case, likely your code will live short because of risks and IT policies ready to uninstall it – Sgdva Jan 18 '22 at 16:20
  • Have you checked it is not a security setting issue? Try some of the solutions here including using medium and checking security settings: https://stackoverflow.com/questions/12965032/controlling-internet-explorer-local-intranet-using-excel-vba – QHarr Jan 18 '22 at 23:41

1 Answers1

0

This issue occurs mostly in relation to .NET Framework. So in order to solve this we need to activate/install .NET Framework in the PC/Laptop running Windows.

See detail instructions:

Run-time error ‘-2146232576 (80131700)’: Automation error in Excel

Noam Brand
  • 335
  • 3
  • 13