Skip to content
Advertisement

Why am I getting a “Permission denied error” while trying to read a cell value using openpyxl python?

Error:

self.fp = io.open(file, filemode) PermissionError: [Errno 13] Permission denied: ‘D:gst_filerinvoice_datajan~$Jan05 Miracle gurukrupa.xlsx’

Code:

JavaScript

Advertisement

Answer

in addition to the answer with with statement (which is very good):

JavaScript

make sure that your file is not used by another process, such as excel app or another program that reads .xlsx

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement