NIDUY FOR SHEM SHOMAYIM L'VATALAH [Niduy: Shem Shamayim l'Vatalah]
Gemara
Nedarim 7b (Rav): If David hears Reuven say Hash-m's Name in vain, he must excommunicate Reuven. If he does not, he should be excommunicated.
This is because poverty frequents places where Hash-m's Name is taken in vain, and poverty is like death.
(R. Aba): A woman said Hash-m's Name in vain in front of Rav Huna. He excommunicated her, and instantly released her, in her presence.
We learn three things from this:
If one hears someone say Hash-m's Name in vain, he must excommunicate him.
If one was present when he was excommunicated, it can be permitted only in his presence.
There is no delay between excommunication and permission.
Mo'ed Katan 16a (Shmuel): We may permit Niduy immediately.
(Abaye): This is only if it was due to monetary matters. If it was for insolence, it must be at least 30 days.
Kidushin 28a (Rav Yehudah): Reuven may even force a man to swear that he is not Reuven's slave.
Objection: We would excommunicate Reuven for suggesting that!
(Beraisa): If Reuven calls Shimon (a Yisrael) a slave, Shimon is in Niduy.
Rishonim
Rif and Rosh (Mo'ed Katan 8b and 3:6): Abaye requires Niduy for insolence to be at least 30 days. The Halachah does not follow him, for Reish Lakish and Rav Huna permitted immediately. However, the insulted party must be appeased first.
Rebuttal (Tosfos Nedarim 7b DH Ein): Niduy for Shem Shamayim l'Vatalah is merely for atonement. It is not like Niduy for other Aveiros.
Nimukei Yosef (Nedarim 1b DH Hazkaras): The Ge'onim obligate excommunicating also for Kinuyim (other names). The Ritva says that we excommunicate only for His (actual) name, Aleph-Dalet and similar special names, but not for His names in other languages. However, we rebuke him.
Ritva (1a DH Mihu): The Ra'avad holds that one is lashed for a false Shevu'ah only if he said Hash-m's name or a Kinuy, for it says "Lo Sisa Es Shem Hash-m la'Shav v'Lo Sishbe'u bi'Shmi la'Sheker."
Korban Nesan'el (10): Tosfos asks, we excommunicate for anything improper! What is the Chidush of Shem Shamayim l'Vatalah? He answers that for this, one who does not excommunicate the offender is in Niduy. However, the Gemara said 'we learn from Rav Huna that one who hears Shem Shamayim l'Vatalah must excommunicate the person.
Rambam (Hilchos Talmud Torah 6:14): We excommunicate for 24 things...(13) one who says Shem Shamayim l'Vatalah or in a Shevu'as Havai (meaningless).
Lechem Mishneh: The Rambam did not list one who heard Shem Shamayim l'Vatalah and did not excommunicate the offender. He must hold that the hearer is automatically excommunicated. The Gemara connotes so. At first it said 'one must excommunicate (the transgressor)', and afterwards it said 'he (the hearer) is in Niduy.'
Rebuttal #1 (Re'em in Shitah Mekubetzes and Ran 7b DH v'Im): Niduy of the listener is not automatic. It cannot be more severe than the transgressor, whose Niduy is not automatic! Also, if Rav decreed that the listener is in Niduy, he could never be permitted, for there will never be a greater Beis Din.
Rebuttal #2 (Tosfos Kidushin 28a DH ha'Korei): We learned that one who calls a Yisrael a slave is in Niduy, yet the Gemara said 'we excommunicate him!' This shows that whenever it says 'is in Niduy', this is not automatic.
Rebuttal (of Ran and Tosfos - Ya'avetz 7b DH Ran v'Im): Who will excommunicate the hearer? If a third person was there, also he is excommunicated for not excommunicating the transgressor! Rather, the transgressor must excommunicate himself. Shortly afterwards the Gemara discusses how Mar Zutra Chasida would excommunicate himself (before excommunicating a Talmid).
Nimukei Yosef (DH Hu): If the hearer did not excommunicate him, it is proper that Shamayim excommunicate and punish him.
Ritz (in Shitah Mekubetzes): The Rambam (Sof Shevu'os) connotes that the hearer is in Niduy if he did not excommunicate the transgressor. Perhaps the Gemara means that the transgressor is in Niduy of Chachamim if the hearer did nothing.
Defense (Einayim l'Mishpat 7b DH uv'Chidushei): Tosfos holds that if Levi heard and did not excommunicate the transgressor and Levi wants to repent, he tells a Chacham, who will excommunicate Levi.
Rambam (Hilchos Shevu'os 12:9): If Shimon said Hash-m's name needlessly, or swore falsely, or made an unnecessary Berachah, he transgressed saying Hash-m's name in vain. One who hears this must excommunicate him. If he did not, he himself is excommunicated. He must permit Shimon immediately, lest people who do not know about the Niduy transgress it. If you would say that he should inform people, the entire world would be excommunicated, for everyone has become used to swearing.
Me'iri (7b DH ha'Shome'a): One who says Hash-m's name needlessly transgresses "Es Hash-m Elokecha Tira". One who hears this must excommunicate the person lest he do so regularly, and cause poverty in his locale, which is like death. The hearer may permit the excommunication immediately, or delay it. Rav Huna permitted the woman immediately to spare her the toil of coming in front of him again to be permitted.
Rambam (10): This is when Shimon was Mezid. If he was Shogeg and did not know that this is forbidden, he need not excommunicate him. I say that he may not excommunicate him, for the Torah did not punish Shogeg. Rather, he should warn him not to do so again.
Nimukei Yosef (ibid.): Rav Huna knew that the woman was Mezid.
Poskim
Shulchan Aruch (YD 334:37): If one heard Shimon say Hash-m's name needlessly, swear falsely, or make an unnecessary Berachah, he must excommunicate him. If he did not, he himself must be excommunicated. He must permit Shimon immediately, lest people who do not know about the Niduy transgress it.
Eshel Avraham (brought in Otzar Meforshim in Friedman Shulchan Aruch 215:1): The SHLaH cites the Ramban to say that if one who said Shem Shamayim l'Vatalah was not put in Niiduy, he must remove his shoes and sit on the ground like one in Niduy, and request three people to permit him.
Shulchan Aruch (38): This is when Shimon was Mezid. If he was Shogeg and did not know that it is forbidden, one may not excommunicate him.
Question: The Tur says so in the name of SMaG, and then says the same in the name of the Rambam. What do they argue about?
Answer #1 (Bach DH u'Mah she'Chosav b'Shem): The Tur means that the SMaG does not require excommunicating him, but one may.
Note: The Gra (56) says that we learn from Yevamos 121a. Rav almost excommunicated one who erred, but was saved. This shows that one may not do so! Perhaps one may not excommunicate a Chacham who erred. However, the SMaG does not distinguish!
Beis Hillel: The Mabit (3:149) says that the same applies to an Am ha'Aretz
Note: The Mabit said that we do not excommunicate an Am ha'Aretz (from Eretz Yisrael who played music on Yom Tov Sheni in Chutz la'Aretz) because he was Shogeg. It is not clear to me that he always exempts an Am ha'Aretz.
Answer #2 (Taz 18): The SMaG discusses only one who did not know that it is forbidden. The Rambam includes every Shegagah, even one who knew the Isur but unintentionally transgressed.
Shulchan Aruch (43): We excommunicate for 24 things...(13) one who mentions Shem Shamayim l'Vatalah or in a Shevu'as Havai.
Taz (20): Why don't we include one who hears Shem Shamayim l'Vatalah and does not excommunicate the transgressor? Perhaps this is only when he knows that the transgressor was Mezid. Usually, he does not know this.