It may or may not work, but I have had success with it. Find another way to say "No."
Offer the child the power of choice, but you pick the options. "You can do this or this."
If an immediate cessation of behavior is required, distract, and go big or go home. Is the child on the floor kicking and screaming? Lay down and kick and scream louder. Just for a moment, and when the child takes that one moment of shocked silence, jump up, and say
"Well that was just silly. C'mon, lets go do..." whatever. Physically take the child's hand and lead them to another spot, even if it is just across the room. You want to condition them to think of this behavior as silly, and to be able to just stop it and move on. Obviously that won't work in public, but anything that is totally a shock to the kid will cause them to stop, for at least a moment, and you have to seize that moment with authority.
OK, there is a little hypnosis in granny's advice, but nothing that will jack with the kid's psyche.
This is the article that got my posting privileges revoked: