Ha - yes, that is a problem!
First, I taught Bailey that yes=treat. The simplist form is to say their name; as soon as you have the dog's attention (just a simple glance your way) then say "yes" and treat. repeat several times. Now they know that yes= treat.
Start with the easy stuff to enforce yes= treat.
However, when Bailey does not obey, then I say no, cross my arms, pause and turn away. I resume in about 10-20 secs.
In your case, he's barking because, I assume, he is excited (Bailey does that too)- but that is unacceptable. So simply say no, cross your arms and pause from the training session. Resume when he calms down. If its totally out of control - just get up, walk away and put the treats up. Session over.
We used these basics to train Bailey and we were very successful.
