From: Rabbi Moshe Sofer
To: Rabbi Avraham
A woman's deathbed testament directing her heirs to invest three hundred gold coins and donate the annual profits to charity was ruled legally invalid on multiple grounds: the recipients were unspecified and the profits were davar shelo ba la'olam, the language used was imperative rather than neder language, and the obligation was to take effect only after death. The Chasam Sofer further distinguished money profits from tree fruits, finding no stable principal to anchor a neder obligation on the heirs, and concluded they cannot be legally compelled to comply.
Source: Shu"t Chasam Sofer CM §110