My grandson can get kicked into hyperdrive when around friends or about to engage in something exciting. If it became a persistent problem, I would sit down with him, when his friends are not about to arrive, and work out a contract. I'd tell him what my needs are (that he keep the volume down; that he listen when I make a request; that he stay in a certain area…) and ask him to propose specific solutions that he can honor. This can be something creative and fun, like "Mom, you can wave a red dishtowel at us when we get too loud." Or, "You can throw a pillow at me to remind me to settle down."
And, just as importantly, agree on a consequence if she ignores the contract. Write it down, remind her of the guidelines next time a visit is imminent. This would ideally be closely related to the visit itself, such as "If I don't _____, I will have to sit in a separate room for X minutes while my friends play." For repeated mess-ups, perhaps her friends will be sent home early, in which case, you'll need to tell the friends about the rule so they can help with compliance.
Punishment delayed until later is seldom effective. Kids, especially when younger, simply don't connect it logically with the misbehavior. The closer a consequence is to the misbehavior, the more the child will connect it with what she just did.
Do try to be a bit lenient on this – it takes awhile to learn new habits, and learning not to be so excited is especially hard. You might compromise by allowing a warning before the boom falls. I always drew a line between "helplessly excited" (and sometimes kids are) and "taking advantage because outsiders are watching."
Also, and this is very important, be sure to appreciate the kids' quieter, saner moments, and thank them with a big smile for behaving so well. Positive reinforcement is often far more powerful than punishment.
The wonderful book How to Talk So Kids Will Listen, and Listen So Kids Will Talk, by Faber and Mazlish, coaches parents on how to help their kids solve problems like this. And many other situations, too.