0
votes

need your help. I need to get all a tags from a company website. But whenever I use this VBA code Set ie = New InternetExplorer, i'll encounter this error below. (but no issues in connecting with google.com, facebook.com)

"Run-time error'-2147417848 (80010108)': Automation error The object invoked has disconnected from its client"

1

And if i change my ie code to Set ie = New InternetExplorerMedium, i can proceed opening the site but warning pop up will show.

This pop up is causing the vba to stop since user needs to click "yes or no" I've created a vbscript but it will stop the process if the pop up window is not the active window.

"To allow this website to provide information personalized for you, will you allow it to put a small file (called a cookie) on your computer?"

2

Need your help here. Thanks a lot.

1
Please include all error messages and code as plain text in the question, itself. Screen shots are not always easy to read and it often helps to be able to copy/paste an error in order to research it. You can use the edit link below the question to change the content.Cindy Meister
Does it make a difference if you add the site to your trusted list? Also, can you provide the URL in question?QHarr
for the runtime error here's the message Run-time error'-2147417848 (80010108)': Automation error The object invoked has disconnected from its client for the 2nd screenshot, pop up error To allow this website to provide information personalized for you, will you allow it to put a small file (called a cookie) on your computer? sorry my 1st time to post something here, just need your help to complete my automation task :) all sites are trusted in IE by the way, also encountered this error using this site accenture.comDennis Cordova

1 Answers

0
votes

For error,"Automation error The object invoked has disconnected from its client". You can try to refer suggestions below.

Try to write code like below.

Sub demo()
Set ie = CreateObject("InternetExplorer.Application")
 Do While ie.ReadyState <> READYSTATE_COMPLETE
 DoEvents
 Loop
ie.Visible = True
ie.navigate ("www.microsoft.com")
While ie.busy
 DoEvents
 Wend

Do While ie.ReadyState = 4: DoEvents: Loop
Do Until ie.ReadyState = 4: DoEvents: Loop

End Sub

'--------------------------OR-----------------------------------
Sub demo()
 Set ie = GetObject("new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")
ie.Visible = True
End Sub

You can also try to disable enhanced protected mode for testing purpose to check whether it solves your issue or not.

Object invoked can disconnect from IE client based on IE security zone settings.
Go to Tools-> IE options -> Advanced tab -> Security section - disable "enable enhanced protected mode".

Reference:

VBA Error: The object invoked has disconnected from its clients