+ Reply to Thread
Results 1 to 4 of 4

error: the object invoked has disconnected from its clients

  1. #1
    Registered User
    Join Date
    07-12-2009
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    49

    error: the object invoked has disconnected from its clients

    Pulling a bunch of data from the Yahoo finance website.. Basically the web-query macro re-runs itself once it finishes.... some sort of loop.

    I've had various errors but managed to get it working, after around 200 lines of data, I get the error:

    "error: the object invoked has disconnected from its clients"

    as I result i've had to auto-save everytime the macro executes.

    Anyone had any experience with this error or suggestions to fix? Also anything that will speed it up?

    When I debug this line is highlighted:

    .Refresh BackgroundQuery:=False

    Attached is the the file, and the code is below:

    Please Login or Register  to view this content.


    p.s I have had to clear the cache everytime the web-query executes in order to over-come a previous error.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: error: the object invoked has disconnected from its clients

    Hello cooper1308,

    The problem is the recorded macro creates a new QueryTable each stock symbol. After a point, you run out of memory, pointers to variables get mixed up, and you get the error.

    This example would need to be modified to work with your data, since I don't know the layout of both pages. I would need to see the workbook to make the appropriate changes. This macro checks if the QueryTable exists or not. If it doesn't exist then it is created. Otherwise, it changes some of the properties and runs the query using the stock symbol in "A1".
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    07-12-2009
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: error: the object invoked has disconnected from its clients

    Ok tried running the above using F8 step by step but wouldn't work.... no data found error)

    Maybe because I am switching between 07 and 03 excel...or does that matter?

    I have attached the spreadsheet, if you can have a quick look that'd be great.

    thanks again!
    Attached Files Attached Files

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: error: the object invoked has disconnected from its clients

    Hello Cooper1308,

    It may have something to do with switching between 2003 and 2007. Not really a good idea. Whenever possible, develop your solution for version of Excel that your system is running.

    I don't have 2007. You will need to save the file in 2003 format. If it works correctly in 2003 then we know it is a conversion problem if it fails in 2007.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1