The object invoked has disconnected from its clients Vbscript and internet explorer
Here was a vbscript that was working well and all of a sudden started throwing this vague error - "the object invoked has disconnected from its clients"
After a lot of research here is what I found that might save your day:
Find the handle of the window and re-associate the object with the handle. (This is what will reconnect your ie client back to the object"
Here is the code:
Set ie = WScript.CreateObject("InternetExplorer.Application")
With ie
hwnd = .hwnd
.Navigate "http://xyz.com"
End With
Set oShell = CreateObject("Shell.Application")
For Each Wnd In oShell.Windows
If hwnd = Wnd.hwnd Then Set ie = Wnd
Next
Happy Coding :)
Just want to say your article is as surprising. The clearness on your publish is simply nice and that
ReplyDeletei can think you are knowledgeable on this subject. Fine
together with your permission let me to clutch your RSS feed to stay updated with drawing close post.
Thanks a million and please keep up the enjoyable work.
Also visit my blog post; Shower Head Filter
Thank you very much. This was just what I needed when I needed it.
ReplyDeleteThanks , Glad that helped!
DeleteBest Regards,
Ady.
Excellent, solves vba CreateObject("InternetExplorer.Application") "The object invoked has disconnected from its clients" ... haven't found the cause yet, but this allows a workaround
ReplyDeleteThat's the best thing when someone else can benefit what you found way back! Glad it worked for you...
DeleteWow! - Thank You.
ReplyDeleteYou are welcome! :)
ReplyDeleteThank you
ReplyDeleteExcellent. In my application I need to run through the loop to search for the window each time before I use the ie object. Odd thing is that on other machines I don't! Thanks very much.
ReplyDeleteI am glad this worked for you!
DeleteCheers,
Ady
Turning UAC off or running the script from elevated command prompt (Run as Administrator) solves the isue too. But your solution is better.
ReplyDeleteCheers :)
ReplyDeleteThank you sooooooooooo much, that solution really work out :)
ReplyDeleteIt's always good to see when things that worked for me in the past works for others!
DeleteI was using Set IE = New InternetExplorerMedium as most people recommended and it was working fine and all of a sudden I had this awful "disconnected" error that was driving me nuts! However, I've tried your method CreateObject("InternetExplorer.Application") and it finally worked!! The issue was with the creation method I guess. Thank you Thank you Thank you Thank you you've saved me hours of going nuts!!! :-)
ReplyDeleteIt's always cool when an old blog post still holds good.
DeleteCheers,
Ady
PERFECT SOLUTION :)
ReplyDeleteyeezy
ReplyDeletelebron shoes
kobe shoes
lebron shoes
westbrook shoes
curry 7 shoes
canada goose
yeezy shoes
curry shoes
jordans
Website louis vuitton replica click to investigate luxury replica bags go right here best replica bags
ReplyDeletecheap jordans
ReplyDeletehermes outlet online
palm angels hoodie
off white hoodie
hermes outlet