"Nein, danke ihnen."
AlonZ, while in speech there is no way to distinguish between a formal "you" and "they", when writing the pronouns related to the formal "you" must always be capitalized, i.e. Sie / Ihnen / Ihr / Ihre / Ihrer. The only exception seems to be the reflexive pronoun "sich".
If you (formally) address someone, you capitalize the pronouns ("Du", "Sie", "Ihnen"). You do that for example in letters or other written text that is directed at someone. I emphasize on the formally, because it is considered to be a courtesy to the person you are addressing. (This is by the way also helpful to distinguish whether for example a "Sie" is to be interpreted as "they" or "you" - but beware, this is one rule many native german speakers (such as me) often ignore, especially when writing less formal stuff like, for example, emails to friends. However, not doing it in a formal letter could actually be considered rude.).
Two things: 1. "ihnen" translates either to "them" (plural) or the formal "you" (singular). The word for "him" would be "ihm". 2. And you cannot thank someone in the third person like that. You could say something like "Ich danke ihm" == "I thank him". Or "Nein, aber ich danke ihm für..." == "No, but I thank him for ..". Or if you use "dank" instead of "danke": "Nein ,dank ihm...", which would translate to "No, thanks to him..". But that I guess would only make sense if you want to say something like "no, thanks to him it is all better now" == "Nein, dank ihm ist jetzt alles besser.", which does not mean "I thank him", but "he is responsible for ..".