n_aizat
n_aizat

Reputation: 13

Python - The process cannot access the file because it is being used by another process:

I made a script to move excel file from source directory to specific directory. The script is work but I receive an error in the VSCode terminal that says:

[WinError 32] The process cannot access the file because it is being used by another process:
File "C:\Users\aizat\OneDrive - PKT LOGISTICS (M) SDN BHD\Desktop\Python Test\Jabil-Inbound.py", line 195, in <module>
        shutil.move(source_dir+file_name,target_dir)

Attached links is my coding in python https://pastebin.com/RSkHLSuU

Upvotes: 1

Views: 1980

Answers (1)

Dafi BH
Dafi BH

Reputation: 26

try replacing writer.save() to writer.close() on line 140

Upvotes: 1

Related Questions