textrotation not working

Issue #654 invalid
Martin Bammer created an issue

I've tried to set textrotation in several ways, but nothing works: cell.style.alignment.text_rotation=90 cell.style.alignment.textRotation=90 cell.style.alignment = Alignment(textRotation=90) cell.style.alignment = Alignment(text_rotation=90)

Comments (3)

  1. Martin Bammer reporter

    Forgot to mention: openpyxl version 2.3.5 (pypi wheel). Python 2.7.12 32bit on Windows.

  2. CharlieC

    Works fine if you follow the correct docs for the version. I don't know where some people look this stuff up but I do wish they check the docs before posting bugs.

    from openpyxl import Workbook
    from openpyxl.styles import Alignment
    wb = Workbook()
    ws = wb.active
    c = ws['A1']
    c.value = "Text"
    c.alignment = Alignment(textRotation=90)
    wb.save("rotation-23.xlsx")
    
  3. Log in to comment