For embedded quotes you can double up with 4 quotes so entire line ends up being one string, like:
“=TEXT(”“”“21424"”“”; “”““0000000"””")”
For “The range does not exist”, you might have a wrong Sheet name or the range field is wrong. So I would check that or you can provide that info here as well.
Thanks @Mikko for this update! I spent a couple of hours struggling with this until I saw your solution.
Excel somehow accepts only a “,” as a separator. Here in Germany (and in some other countries), Excel uses “;” as a separator in formulae. Writing the “;” in the formula throws the range not found error, whereas using a “,” instead resolves it automatically.