My baby does the same thing sometimes...just all of a sudden run from one side of the house to the other all around the chairs and under the tables it is so funny and she too hacks and coughs sometimes when she gets overly excited! When I first got her I thought she might have kennel cough or something because she was coughing but she has grown out of it and now rarely coughs (when she gets extremely excited like when someone comes home or she gets to meet another dog)

and I have taken her to yorkie play dates in the area and I hear other yorkies hacking and coughing too. I guess it is just something they do when they get excited...some people have told me they grow out of it. Hope this helps!