Closely related to this question but a little bit different.
I open an excel file with openpyxl, which works fine.
import pandas as pd
from openpyxl import Workbook, load_workbook
file_name = 'Excel_File.xlsx'
Then I define a function which opens a sheet from the file and reads in data with the pandas package:
def exm_fct():
sheet = 'sheet_name'
read_data = pd.read_excel(file_name, sheet_name=sheet, engine='openpyxl', usecols="A:C", skiprows=1)
return read_data
When I apply the function for the first time, everything goes right. But when I do it for the second time, I get the BadZipFile: File is not a zip file
-Error and the Excel File is corrupted and I can't even open it in Excel anymore.