Looks like this issue has been encountered a number of times on other forums without solution (other than obviously just using the excel version/computer that works!).

maybe you should revisit why you want to use the before_close and maybe there is another way of looking at the problem, assuming this is a significant issue on your side.