'NoneType' object has no attribute 'iter_rows'

243 views
Skip to first unread message

hpm...@gmail.com

unread,
May 15, 2017, 4:22:24 AM5/15/17
to openpyxl-users
Hello!

First of all, I'm using openpyxl version 2.0.4. I can't update it, because it's on a Jenkins server, and a lot of us uses this version. I can't mess their work up.
So basically I have the following lines:

wb = load_workbook(filePathToPAD, data_only=True, use_iterators=True)
ws
= wb.get_sheet_by_name('SW_Modules')
...
...
...
for row in ws.iter_rows():
    rowNumber
+= 1
    colNumber
= 0
   
for cell in row:
        colNumber
+= 1
...
...

And I get the error from the Subject:
'NoneType' object has no attribute 'iter_rows'

At the line (for row in ws.iter_rows(): )

I don't have any idea where I went wrong, could you please give me a heads up?
(The sheet exists, the workbook I load exists, everything seems to be all right)

Charlie Clark

unread,
May 15, 2017, 5:53:59 AM5/15/17
to openpyx...@googlegroups.com
Am .05.2017, 10:22 Uhr, schrieb <hpm...@gmail.com>:

> And I get the error from the Subject:
> 'NoneType' object has no attribute 'iter_rows'

Well, obviously you don't have a worksheet object. openpyxl 2.0.4 is not
supported but the documentation for the version is still online.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
Reply all
Reply to author
Forward
0 new messages