Problem:
Orders are sent as an Excel template from the headquarter to a SharePoint folder "Orders for the fitter" and processed there by a fitter on his tablet. The fitter opens the Excel and marks the work he has done. A software (VBA) saves the edited Excel to a folder "completed orders" under a new name, closes the template and then deletes the template for the order in the folder "Orders for the fitter". This only works as long as the fitter is online. If he is offline, only the completed job is created in the "Completed Jobs" folder
and the completed job is not removed from the "Jobs for the Fitter" folder.
It can be demonstrated that the Excel to be deleted is closed. Nevertheless, it will not be deleted.
It can also be demonstrated that basically deleting this Excel from another Excel works offline, just not from the generated Excel stored in the folder "completed jobs".
Cause:
Cause is OneDrive denies access. If you stop OneDrive by hand, before editing, the Excel template will be deleted from the folder "Jobs for the fitter" even if there is no Internet and a move is also possible.
Error Message:
The error message denying deletion by VBA is "Access Denied". The Excel template can be deleted manually.
Required solution:
A solution is required that allows a program to delete the template from the folder "Orders for the fitter".
This Problem was already a support Case request (29445475)
Raul sent me a solution, I tested the solution and it seemed to work and we closed the Case. But later I found I was wrong, it does not work, I did not test correct, probably OneDrive was closed when we tested, and I did not recognise it.

