Unable to find my worksheets in a file , there is at least 1 worksheet - version 3.0.10
Hi guys ,
I'm trying to read the attached file which contains 1 sheet.
The code
import openpyxl
file_path = '/Test.xlsx'
dataframe = openpyxl.load_workbook(file_path)
# Define variable to read sheet
dataframe1 = dataframe.active
# Iterate the loop to read the cell values
for row in range(0, dataframe1.max_row):
for col in dataframe1.iter_cols(1, dataframe1.max_column):
print(col[row].value)
The error
Exception has occurred: AttributeError 'NoneType' object has no attribute 'max_row' File "/test.py", line 8, in <module> for row in range(0, dataframe1.max_row): AttributeError: 'NoneType' object has no attribute 'max_row'
Please help , thank you