Python Forum

Full Version: Getting error while loading excel(.xlsx) file using openpyxl module
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

import openpyxl
#Path of workBook
path = "C:\\***\\python_sheet.xlsx"

#Load worksheet from the directory(path)
wb = openpyxl.load_workbook(path)
Getting following error while loading excel file from directory, even though excel it is not a zip file
[Error :]
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

How do we solve this problem
(Mar-01-2019, 09:41 AM)shubhamjainj Wrote: [ -> ]even though excel it is not a zip file
you would be surprised to learn that new excel format i.e. xlsx, xlsm, etc... are indeed zip