PermissionError: [Errno 13] Permission denied: 'Abc.xlsx'

Chris Angelico rosuav at gmail.com
Thu Feb 10 14:43:06 EST 2022


On Fri, 11 Feb 2022 at 06:41, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
>
> On Wed, 9 Feb 2022 18:50:12 +0000, MRAB <python at mrabarnett.plus.com>
> declaimed the following:
>
> >On 2022-02-09 12:45, Christian Gollwitzer wrote:
>
> >> It's impossible. Excel locks the file deliberately when it is open, so
> >> that you can't overwrite it from a different program. Otherwise, the
> >> file could become inconsistent.
> >>
> >It's the same the other way too; you can't open the file in Excel while
> >Python has it open.
> >
>         While not tested with Excel, I /have/ encountered cases where an
> application has locked the file for writing, but multiple readers are
> permitted. Those would fail then if one attempts to write. {The other view
> point is a library that does a complete open/read\write-all/close to memory
> -- such an application might open/read/close, then Excel opens/locks, with
> the application only learning of the change when it attempts the
> open/write/close cycle}
>

Yeah, I doubt Excel is that sophisticated. It's built on an assumption
of single-user operation.

ChrisA


More information about the Python-list mailing list