If you are having this error with an Excel file saved in SharePoint Online being stuck at “Performing Cleanup” when closing the file, this fix might help you. Also, the file is somehow cached locally and does not update with the current online version of the file. Onedrive reset also does not help.
Empty this folder:
%localappdata%\Microsoft\Office\16.0\OfficeFileCache
This might also help you: