Python Global Variable Not Accessible In Function On Excel