This should avoid errors when the sheet is still open in Excel.
In the future, I should refactor all the other places as well