+ Reply to Thread
Results 1 to 16 of 16

VBA Error: "The object invoked has disconnected from its clients"

  1. #1
    Registered User
    Join Date
    07-18-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    28

    VBA Error: "The object invoked has disconnected from its clients"

    Hello,

    I have some code that has started throwing an error "The object invoked has disconnected from its clients". It works sometimes and does not work at others. I have an older version of the model im working in and when I first copy this code into that model and run it, it works fine. If I then try running the model a second time the error appears and the model crashes. I am using Excel 2010. Help Please!!

    Please Login or Register  to view this content.
    Last edited by elevate_yourself; 10-28-2014 at 06:42 PM.

  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,259

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Hello elevate_yourself,

    Which line does the error occur on?
    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-18-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    28

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Oh sorry - I have edited the post to bold the line

  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,259

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Hello elevate_yourself,

    Since it is a simple paste operation, I would suspect that there is query on the worksheet that is trying to refresh itself or the data it is trying to import can not be found.

  5. #5
    Registered User
    Join Date
    07-18-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    28

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Hi Leith Ross,

    What do you mean by the worksheet trying to refresh itself? What should I be looking for?

    I do prefix these scripts with a Application.Calculation = xlCalculationManual to try and prevent anything from refreshing during the process

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

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Hello elevate_yourself,

    This error occurs with automated objects like a web query or pulling data using SQL. Turning off formula calculations would not cause this error.

    Do you have any external links in the workbook?

  7. #7
    Registered User
    Join Date
    07-18-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    28

    Re: VBA Error: "The object invoked has disconnected from its clients"

    There are some pivot tables grabbing data from external sources - would that count? And I was trying to add a web query data pull as well right before this script runs. Also later on in the code there is a data pull using SQL - thought that step should not have happened when I am running this part.
    Last edited by elevate_yourself; 10-29-2014 at 10:32 AM.

  8. #8
    Registered User
    Join Date
    07-18-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    28

    Re: VBA Error: "The object invoked has disconnected from its clients"

    If it helps, this is the code for the button I use to run the model

    Please Login or Register  to view this content.
    Thanks!
    Last edited by elevate_yourself; 10-29-2014 at 02:40 PM.

  9. #9
    Registered User
    Join Date
    07-18-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    28

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Also if there is another way to write the code such that you can go and grab a file name, select content on a sheet, copy it and paste it into your current worksheet, I have no issue changing the code so that this error doesn't happen. I dont know if thats easier or not but wanted to throw it out there.

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

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Hello elevate_yourself,

    All of the things you mentioned in post #6 are possible causes of a "disconnect". I really can not answer your last post, since I have no intimate knowledge of the processes you are using.

  11. #11
    Registered User
    Join Date
    07-18-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    28

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Hi Leith Ross,

    Hmmm alright. Is there any information I can provide to help? I have spent the better part of the last two days trying to get this to work and still have had no success. Is there any standard things I can try to look for that might cause the issue? Is there a way to prevent the background refreshing that would lead to a disconnect? Im really just looking for anything to even point me in the right direction.

    Thanks!

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

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Hello elevate_yourself,

    If you worksheet is not dependent on the data from the SQL, Pivot Tables, and Web Query, I would remove them.

    If you are simply opening a another workbook, copying a range, and pasting to another worksheet, removing these things should not present any problems.

  13. #13
    Registered User
    Join Date
    07-18-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    28

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Hi Leith Ross,

    Unfortunately I need the data from all those sources. However they are not party of this worksheet. On this particular worksheet however non of that is going on - the only code or references running on this worksheet is the copy/paste.

    I think however I have found a way to make it work. I have changed how the code worked and the issue has gone away. What I did was copy the source file location into the worksheet and then used that as the reference. Code outlined below:

    Please Login or Register  to view this content.

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

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Hello elevate_yourself,

    Good job, looks like you solved the problem. With out the workbook and seeing the parts that feed it, it is really difficult to "guess" what the problem could be.

  15. #15
    Registered User
    Join Date
    07-18-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    28

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Hi Leith Ross.

    Thanks for your help! I totally understand and appreciate you providing your time to help troubleshoot.

    Cheers

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

    Re: VBA Error: "The object invoked has disconnected from its clients"

    Hello elevate_yourself,

    I really didn't do anything. You did all the work.

    'S math a rinn thu!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. "Automation error: The object invoked has disconnected from its clients"
    By nozombie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-24-2014, 05:53 PM
  2. Recieving the error "the object invoked has disconnected from its clients"
    By chidmas in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-13-2013, 07:52 AM
  3. Replies: 0
    Last Post: 05-23-2013, 09:12 AM
  4. "The object invoked has disconnected from its clients"
    By ianpwilliams in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-21-2013, 01:01 PM
  5. Automation Error: "The object invoked has disconnected from its clients"
    By cartman44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2009, 04:51 PM

Tags for this Thread

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