I created an excel file to read in some formula-linked values, and I wish to delete file at the end of the process but I get the below error:
PermissionError: [WinError 32] The process cannot access the file because it is being used by another proces
I have already closed the file prior to deletion. Can someone assist? Thank you
shutil.copy(file,'file2.xlsm')
file2=os.path.abspath('file2.xlsm')
wb2=openpyxl.load_workbook(file2, data_only=True, read_only=True, keep_vba=True, keep_links=True)
*Code to read in values from wb2*
wb2.close()
os.remove(file2)