Does anyone know where the Segulah to say Nishmas Kol Chai for 40 days comes from? Apparently it is mentioned in the name of Rebbetzin Kanievsky, but I couldn't find anything.
I haven't found the source for why specifically 40 days, but in this essay, Rabbi Stel explains the origins of the segulah of saying Nishmat for any sort of trouble that befalls a person. It's long and in Hebrew, so I'll give a short summary in English:
The second aspect of the segulah, that relates it to any sort of trouble that befalls a person...was brought by Rabbi Eliezer Papo in his book "Chesed L'alafim": "We have a kabbalah (tradition) in our hands from R"Y Hachassid (Rabbi Yehudah Hachassid) that the praise 'Nishmat Kol Chai' is suitable for any trouble, for a person to accept upon himself that when he shall be saved from it he shall say 'Nishmat Kol Chai' in thanks and voice of song before ten [men]. And with this many were saved." (Chesed L'alafim, Orach Chaim, siman 281, seif katan 4).
Though Rabbi Eliezer Papo isn't the originator of this 'kabbalah'...many copied from his book, such as: [The Kaf Hachaim, the Ben Ish Chai...], but the original source for this segulah appears in the book Chemdat Yamim...written anonymously and even suspected of Sabbateanism and is greatly controversial. In it is written:
"And in its might, many Anshei Shem were able to receive a prophetic speech in their mouths through the yichudim and kavanot in the beautiful text 'Nishmat Kol Chai'...and we have a kabbalah [tradition] in our hands from R"Y Hachassid peace be upon him, that it is suitable for any trouble that may not come, for a man to accept upon himself, that when he shall be saved from it, he shall say 'Nishmat Kol Chai' in thanks and voice of song before ten [men]. And with this many were saved. And I have checked and tested this myself." (Chemdat Yamim pt. 1 (for Shabbat and Yom Tov), Shabbat, ch. 11)
There are sources that say if someone is seeking a yeshua (a salvation) from a particularly difficult time they should take on a neder (a vow) to say Nishmas following the ensuing salvation.
It brings down here that the Ben Ish Chai in תולדות שנה ב, סעיף ג, שו"ת מכתם לדוד אורח חיים סימן יג is a proponent of this idea. And also both the Kaf Hachaim Orach Chaim 281:8 and Rav Chaim Palagi in Chaim LaRosh bring this practise down.