I want to read the cell value in Excel and change the file name to that value
I'm probably getting the Excel file from Python
[WinError 32] The process is inaccessible because another process is using the file:
I think that's the error.
Unloading the Excel file after charging the cell price? Is there a way to do it?
load_wb = load_workbook("@@@.xlsx", data_only=True)
print ("Excel Loading")
#Call by sheet name
load_ws = load_wb["sheet1"]
print ("sheet loading")
#Output value to cell address
cell = load_ws['a1'].value
print ("cell loading")
print(cell)
newname = cell[42:]
print("New name tag = "+newname")
old_name = "@@@.xlsx"
new_name = "@@@"+"_"+newname+".xlsx"
os.rename(old_name, new_name)
I solved it with .close
© 2024 OneMinuteCode. All rights reserved.