none
Cannot access a disposed object. Object name: 'TdCommand'. RRS feed

  • Question

  • Hi,

    I'm trying to load a query to table and data model. However, the error hinder the process. Could anyone give me some hint why this error pops out?

    Thanks and regards,

    Qilong

    Friday, May 15, 2015 12:55 AM

Answers

  • Do you have any other Excel addins that "TdCommand" might be a part of? Although the error dialog was generated by Power Query, that name doesn't appear in our code base.

    Please use "Send a Frown" to report the problem and edit the email to include any information you have about other addins that might be installed.

    EDIT: Wait, are you using Teradata?
    Friday, May 15, 2015 3:10 PM

All replies

  • Looks like the query you're trying to load refers to another query that has been deleted meanwhile. This normally couldn't happen if you want to delete through the editor (it will throw error message that the query is referenced by another query).

    However, if you're copy-&pasting code via the advanced editor, things like that could be the result.

    Another reason could be non-refreshing previews that result in not using the current code (this drove me nuts in a 2010-version at a clients site). There you'd have to refresh every single step manually.


    Imke

    Friday, May 15, 2015 7:33 AM
    Moderator
  • Hi Imke,

    I do refer to another query, but that query hasn't been deleted. They are actually the same query... The reason I did this is because... I need to add two calculated columns to the query and I can only get those two columns by using the "group by" functionality (the calculation can be refered to https://social.technet.microsoft.com/Forums/en-US/48fe1abe-a345-486f-90ad-3ed024d6d200/is-there-any-possible-that-i-can-realize-the-functionality-of-sumif-in-the-power-queryquery?forum=powerquery#905cb893-ffe9-4c60-ba83-b84ee788a04f). Once the "group by" is done to the query, only the two new added columns and the reference column remain. All other columns gone. To deal with this situation, I normally merge the step of the "group by" with the previous step. It, however, didn't work for this query, so I tried to copy & paste the code to generate a new query without the group by step added then tried to merge these two queries in this way, however, it still coundn't work...

    Thanks and regards,

    Qilong

    Friday, May 15, 2015 8:21 AM
  • Hi Qilong,

    might be that the reason for "however the merge with the previous step" didn't succeed is causing this problem as well.

    Does the query deliver results before you do the merge?

    (Wondering how you adress the same query with it's query name within the code - wouldn't that give circular depenencies or not being recognized at all?)


    Imke

    Friday, May 15, 2015 8:35 AM
    Moderator
  • This is probably a bug in the software. Have you gotten it multiple times? Can you reproduce it consistently? Even after closing and re-opening Excel? Is "TdCommand" the name of one of your queries?

    Friday, May 15, 2015 11:33 AM
  • Hi Imke,

    I think there might have some misunderstanding here. My apologies. The query can deliver results before the merge is done and actually even after I did the merge operation, the results can still be delivered normally in the Query Editor. I just couldn't get the results loaded to the PP.

    As to your query name question, there's no query name that is embeded in the code.

    Thanks.

    Qilong

    Friday, May 15, 2015 12:25 PM
  • Hi Curt,

    I do encountered this error constantly. Yes. Even after closing and re-opening Excel. No. the "TdCommand" is not the name of any of my queries. I have no idea what that stands for as well.

    Thanks.

    Qilong

    Friday, May 15, 2015 12:28 PM
  • Do you have any other Excel addins that "TdCommand" might be a part of? Although the error dialog was generated by Power Query, that name doesn't appear in our code base.

    Please use "Send a Frown" to report the problem and edit the email to include any information you have about other addins that might be installed.

    EDIT: Wait, are you using Teradata?
    Friday, May 15, 2015 3:10 PM
  • Hi Curt,

    Yes, I am using Teradata and I sent the error to the PQ team when I encountered the error at the first time, but I haven't got any responses yet.

    Thanks and regards,

    Qilong 

    Monday, May 18, 2015 12:53 AM