Python openpyxl in use [WinError 32] The process is inaccessible because another process is using the file

Asked 2 years ago, Updated 2 years ago, 63 views

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)

python openpyxl

2022-09-21 10:00

1 Answers

I solved it with .close


2022-09-21 10:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.