Generated margin statement incompatible with Excel 2010

Issue #185 resolved
Anonymous created an issue

Hello Eric, great stuff. I came across one issue. When defining margins using oWS.page_margins.right = float(u"1.0"), Excel-2010 flags an error that it can not read the file anymore. When digging into the xml files I found out that openpyxl generates <pageMargins left="1.00"></pageMargins> whereas if I write an xlsx out of the tool the xml looks like <pageMargins left="1.00" />

I observed this for versions 1.5.8 and 1.6.1 on Vista-32. Root cause is that the pageMargins are written using tag() (writer\worksheet.py) which is built as a sequence of start_tag() and end_tag() (in shared\xmltools.py) To my limited xml-knowledge the generated code looks ok but Bill Gates seems to have a different opinion. Best regards and thanx for your great work Stefan (stefanhamacher_at_gmx.net)

Comments (4)

  1. Log in to comment