Z
Z
Zafir2022-04-18 19:26:58
Python
Zafir, 2022-04-18 19:26:58

It is not possible to make changes to the Excel file while it is open. openpyxl. Python. What can be done?

It is not possible to make changes to the Excel file while it is open. I am using openpyxl. While the file is closed, all data is written, if opened, a PermissionError is thrown

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Nesterov, 2022-04-18
@AlexNest

Wait until it closes. Excel does not allow two processes to open a file.

E
Elvis, 2022-04-18
@Dr_Elvis

Close. Your cap.

D
denislysenko, 2022-04-18
@denislysenko

overwrite this Excel file
That is, delete the old one and write a new one with the same name

R
rPman, 2022-04-18
@rPman

before opening, add a macro to the document (or write it to new templates) that will receive commands from your external program using some protocol and edit the document.
the lion's share of coding here is exactly the means of communication IPC
ps can push all the logic completely into the scripts of the document? and not write it in python (although VBS is still a language)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question