Skip to content

Error using read_style #37

@sweco-sekrsv

Description

@sweco-sekrsv

Hi!

I am struggling to get my simple piece of code working(I want to read the style from the excel):

from StyleFrame import StyleFrame, utils

sf = StyleFrame.read_excel('sss.xlsx',read_style=True, sheetname='Documents' )
print(sf)

This results in the following error:

Traceback (most recent call last):
  File "merge_excel4.py", line 3, in <module>
    sf = StyleFrame.read_excel('sss.xlsx',read_style=True, sheetname='Documents' )
  File "C:\Users\krill\AppData\Local\Programs\Python\Python36\lib\site-packages\StyleFrame\style_frame.py", line 178, in read_excel
    _read_style()
  File "C:\Users\krill\AppData\Local\Programs\Python\Python36\lib\site-packages\StyleFrame\style_frame.py", line 154, in _read_style
    theme_colors = _get_scheme_colors_from_excel(wb)
  File "C:\Users\krill\AppData\Local\Programs\Python\Python36\lib\site-packages\StyleFrame\style_frame.py", line 138, in _get_scheme_colors_from_excel
    root = fromstring(wb.loaded_theme)
  File "C:\Users\krill\AppData\Local\Programs\Python\Python36\lib\xml\etree\ElementTree.py", line 1314, in XML
    parser.feed(text)
TypeError: a bytes-like object is required, not 'NoneType'

However removing read_style=True it runs just fine. Any ideas?

openpyxl = 2.2.5
pandas = 0.22.0
python = 3.6.6 64 bit
StyleFrame = 1.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions