Hi Cirlaw,
Thank you for reaching out to Microsoft Community.
Attaching the Surface Pen on the magnetized side of the Surface Pro does not charge the Surface Pen. The pen that comes with the Surface Pro 7 is the Surface Pen with no clip as shown on this page. Surface Pen with no clip has a AAAA battery inside that you can replaced if it runs out of battery. You may check this page on how to Change Surface Pen batteries.
If this answer your question, we highly encourage you to inform our Community by clicking on Yes or marking my post as an answer. This will help other members who may have the same issue as you. Otherwise, don't hesitate to update us so we can further assist you.
Kind Regards,
Marrion Y.