user2205614
user2205614

Reputation: 81

openpyxl xlsx file cell value = none

I want to read an xlsx file using openpyxl. Here is the typical code i use:

import openpyxl

wb = openpyxl.load_workbook("example.xlsx")
sh = wb.get_sheet_by_name(name="Sheet3") or wb.get_sheet_by_name(name="Section3")
for rownum in range(1, sh.get_highest_row()):
    print str(sh.cell(row=rownum, column=1).value)

In this example i'm able to find values from the 1st column. The problem is i have data in the second column and others column but in output i got None....

Any help will be appreciate.

Upvotes: 3

Views: 2248

Answers (1)

user2205614
user2205614

Reputation: 81

It works with the library xlrd. The excel file is generated with a java library.IT look's problematic with this way of creation. Open it with excell 2013 and save it as a new xlsx file works also better.

Upvotes: 1

Related Questions