This is another one of those what do you want the dog to do instead? questions. Likely, you want the dog to sit, so it begs the question, how well does your dog know sit? Bombproof sit and generalize it to when your dog greats guests.
It would also be prudent to work on impulse control, so see the Doggy Zen sticky.