Yes, it should be a sub rather than function.
if you save it as a dvb, use vbaman at the command line to load it. But I would open the vba ide and just paste the code in the ThisDrawing module.
Then F5 to run it. (or vbarun at the command line)
But do change Public function to public Sub and change End Function to End Sub.