Reading headers not working

Issue #392 resolved
Holger Hoefling
created an issue

I was trying to use openpyxl to read headers in some excel files I have. Despite seeing headers in Excel, the library does not return them. So I generated an example that also seems not to work. In the attached excel file, I inserted a left header. In the attached code I try to read it but always get the response "None"

from openpyxl import load_workbook

wb = load_workbook("HeaderNotWorkingExample.xlsx")
sheet wb.active
assert sheet.header_footer.hasHeader()

Comments (5)

  1. Charlie Clark

    Wow, the formatting language for headers and footers is truly horrible. My initial guess that we don't support reading existing headers and footers is wrong and @Adam Morris has done a great job trying to implement the specification: the various parts of a footer are lumped together with the formatting. The current code is being tripped up by a very simple bit of code &Ltest header. It looks like &L&test header is expected.

  2. Log in to comment