When I first got my present dog I had lots of trouble with barking and excitement and pinch biting. We still have moments when excited barking take over, usually when my husband is around. Unfortunately, there is no "instant cure". But there is a way to control it.
First, yelling or raising your voice only makes the dog more excited. You must practice deep breathing and get yourself into a calm and assertive mood. Think about your mom or grandmom or a teacher who could settle you down with a look. Become that person before you step into the room with the dog.
Stay in that persona. Pull yourself up as large as you can and lean forward toward the dog. Stay calm and assertive and very quiet.
What works best for me whenever my dog gets into this state is to just keep walking forward holding out my arms and standing as tall as I can stretch until he is backed into a corner. When I keep coming, calmly, quietly, his look changes. When he finally is in the corner or positioned so he can't escape I take over as much space around him as I can by still leaning toward him. I wait for the head to droop and the body to relax, then put on the collar and lead. I make him stay seated for a minute before inviting him to go with me. It's gotten so that now he is calm and submissive before we ever reach the corner, but I still follow through anytime he shows excitement.
Yes the mouth does snap when he starts yapping and if you reach toward him before he is calm and submissive you risk a brush with teeth that don't really bite. You stuck your hand in his mouth mid bark. However, reaching toward him only excites him more. You have to stand quietly, calmly and wait until he absorbs your calm energy.
He shall be everything humanity strives to be: Honest, Loyal, Kind in Heart, and Strong in Spirit. Therefore, you shall call him Partner and Best Friend."
Author Unknown