Traceback (most recent call last):File "<pyshell#18>", line 1, in <module>wb = openpyxl.load_workbook(r"C:\Users\Florian\Desktop\report\12.07.2014\savings_edited.xlsx")File "C:\Python341\lib\site-packages\openpyxl\reader\excel.py", line 165, in load_workbook_load_workbook(wb, archive, filename, use_iterators, keep_vba)File "C:\Python341\lib\site-packages\openpyxl\reader\excel.py", line 212, in _load_workbookstyle_properties = read_style_table(archive.read(ARC_STYLE))File "C:\Python341\lib\site-packages\openpyxl\reader\style.py", line 222, in read_style_tablep.parse()File "C:\Python341\lib\site-packages\openpyxl\reader\style.py", line 39, in parseself.font_list = list(self.parse_fonts())File "C:\Python341\lib\site-packages\openpyxl\reader\style.py", line 91, in parse_fontsyield self.parse_font(node)File "C:\Python341\lib\site-packages\openpyxl\reader\style.py", line 106, in parse_fontreturn Font(**font)File "C:\Python341\lib\site-packages\openpyxl\styles\fonts.py", line 86, in __init__self.family = familyFile "C:\Python341\lib\site-packages\openpyxl\styles\hashable.py", line 54, in __setattr__return object.__setattr__(self, *args, **kwargs)File "C:\Python341\lib\site-packages\openpyxl\descriptors\__init__.py", line 87, in __set__super(Min, self).__set__(instance, value)File "C:\Python341\lib\site-packages\openpyxl\descriptors\__init__.py", line 66, in __set__raise ValueError('Max value is {0}'.format(self.max))ValueError: Max value is 14
Am .08.2014, 21:29 Uhr, schrieb <ders...@gmail.com>:
> HI Charlie,
> i again have almost the same problem, but in this case i updated python
> to
> 3.4.1 and also openpyxl to 2.0.5
> I attached you a cleaned file, when I now open it, it gives me some more
> errors:
> Do you see any solution for this file?
That is a blatant specification violation:
<xsd:simpleType name="ST_FontFamily">
<xsd:restriction base="xsd:integer">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="14"/>
</xsd:restriction>
</xsd:simpleType>
This is currently implemented strictly (what's the point of specs if you
don't try and enforce them? answer: when Microsoft writes them) which is
why you get the error. Please file an issue with the Apache library.
You can easily monkey patch around this in styles/fonts.py
Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> wb = openpyxl.load_workbook(r"xxx.xlsx") File "C:\Python341\lib\site-packages\openpyxl\reader\excel.py", line 165, in load_workbook _load_workbook(wb, archive, filename, use_iterators, keep_vba) File "C:\Python341\lib\site-packages\openpyxl\reader\excel.py", line 212, in _load_workbook style_properties = read_style_table(archive.read(ARC_STYLE)) File "C:\Python341\lib\site-packages\openpyxl\reader\style.py", line 222, in read_style_table p.parse() File "C:\Python341\lib\site-packages\openpyxl\reader\style.py", line 41, in parse self.border_list = list(self.parse_borders()) File "C:\Python341\lib\site-packages\openpyxl\reader\style.py", line 143, in parse_borders yield self.parse_border(border_node) File "C:\Python341\lib\site-packages\openpyxl\reader\style.py", line 156, in parse_border border[side] = Side(**bside) File "C:\Python341\lib\site-packages\openpyxl\styles\borders.py", line 48, in __init__ self.style = style File "C:\Python341\lib\site-packages\openpyxl\styles\hashable.py", line 54, in __setattr__ return object.__setattr__(self, *args, **kwargs) File "C:\Python341\lib\site-packages\openpyxl\descriptors\__init__.py", line 105, in __set__ raise ValueError("Value must be one of {0}".format(self.values))ValueError: Value must be one of (None, 'dashDot', 'dashDotDot', 'dashed', 'dotted', 'double', 'hair', 'medium', 'mediumDashDot', 'mediumDashDotDot', 'mediumDashed', 'slantDashDot', 'thick', 'thin')