Automation Error - The Object invoked has disconnected from its clients-VBForums
Results 1 to 2 of 2

Thread: Automation Error - The Object invoked has disconnected from its clients

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2011
    Posts
    1

    Automation Error - The Object invoked has disconnected from its clients

    Below is a VB6 code snippet that worked flawlessly on Windows XP, but now throws this error on Windows 7...

    Error Number: -2147417848
    Error Description: Automation Error
    The Object invoked has disconnected from its clients.

    Code:
    Option Explicit
    
    Sub dsnSave()
    
        Dim ieApp As Object
            
        Set ieApp = Nothing
        Set ieApp = CreateObject("InternetExplorer.Application")
        With ieApp
            .Visible = False
            While .Navigate(myUrl): Wend
            While .Busy: Wend
    
    ...
    IE opens & navigates to the specified URL, albeit visible despite setting .Visible = False. While checking the .Busy status is where it errors. I assume it is due to Q319832, but I don't understand sufficiently to correct my code.

    Any help would be greatly appreciated!

    patrick

  2. #2
    Fanatic Member FireXtol's Avatar
    Join Date
    Apr 2010
    Posts
    874

    Re: Automation Error - The Object invoked has disconnected from its clients

    Hmm. The KB article is about early binding. You're doing late binding.

    I would suggest creating the object in form_load or similar. Have it be a one-time event. Instead of destroying it and recreating it like you're doing.

    You're probably destroying the [old] object while still referencing it(like in one of your many loops). With/End With will also cause its own persistent reference(while inside the block).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.