Column iteration

Issue #1295 invalid
Stanislav created an issue

Hello! When I doing iteration by column, I have error “AttributeError: object has no attribute upper“

for col in ws1[1]: get_column_letter(column_index_from_string(col.column)+1)

I don`t have this error, when I using openpyxl 2.5.4. i payng attention that ‘col’ is str ‘ZZZ’ in current version or cell-object. ‘col’ was ‘Cell’-object in 2.5.4v strongly.

Comments (4)

  1. CharlieC

    The API has changed to use numerical (1-based) indices for columns so there is no need for the double conversion. Just use cell.offset(column=1) method to get the next cell and cell.column_letter if you want the alphabetical reference.

  2. Log in to comment