Python Global Variable Not Updating In Function In Excel