Cannot delete an Excel file because it is locked during python script “[WinError 32] The process cannot access the file because it is being used…”
I am using Notebooks in ArcGIS Pro (v3.3) to execute a python script. The script downloads Excel data from a hosted feature service. Using the openpyxl library, the script opens an empty excel template and transfers data into the template. Then the script saves the template, which now contains data, as a separate file. The final step is to remove the template, and at this step, I get an error message saying:
“[WinError 32] The process cannot access the file because it is being used by another process”.