Error:
self.fp = io.open(file, filemode) PermissionError: [Errno 13] Permission denied: ‘D:gst_filerinvoice_datajan~$Jan05 Miracle gurukrupa.xlsx’
Code:
JavaScript
x
5
1
wb = openpyxl.load_workbook(filename=os.path.abspath(file), read_only=True)
2
ws = wb.active
3
cell_val = ws.cell(row=6,column=2)
4
print(cell_val)
5
Advertisement
Answer
in addition to the answer with with statement
(which is very good):
JavaScript
1
3
1
elf.fp = io.open(file, filemode) PermissionError: [Errno 13] Permission denied:
2
'D:gst_filerinvoice_datajan~$Jan05 Miracle gurukrupa.xlsx'
3
make sure that your file is not used by another process
, such as excel app
or another program that reads .xlsx