I am reading existing xlsx sheet and writing data into that using openpyxl,but for reading sheets I used 'load_workbook'is that right way to get sheet from existing xlsx file,it showing error
I go t error like this:
Traceback (most recent call last):
File "C:\Users\USER\Documents\Scripts\Practice\ExcelRead.py", line 78, in <module>
wb = load_workbook(filename = 'Copy.xlsx', use_iterators = True)
File "C:\Python27\lib\site-packages\openpyxl\reader\excel.py", line 141, in load_workbook
archive = ZipFile(f, 'r', ZIP_DEFLATED)
File "C:\Python27\lib\zipfile.py", line 770, in __init__
self._RealGetContents()
File "C:\Python27\lib\zipfile.py", line 811, in _RealGetContents
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file
How to read and write into existing XLSX sheet here I used openpyxl but its not writing into that sheet
Did you try storing the excel file and the .py file in the same folder and then execute wb = load_workbook('Copy.xlsx')