<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Steph Mojekwu</title>
    <description>The latest articles on DEV Community by Steph Mojekwu (@missyneon).</description>
    <link>https://dev.to/missyneon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1083445%2F8919517b-42eb-4e75-ae26-e595a1da363c.png</url>
      <title>DEV Community: Steph Mojekwu</title>
      <link>https://dev.to/missyneon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/missyneon"/>
    <language>en</language>
    <item>
      <title>load_workbook fails when loading excel file with blue style fill in cells. How do I fix the error? Click post to see error.</title>
      <dc:creator>Steph Mojekwu</dc:creator>
      <pubDate>Tue, 16 May 2023 00:18:07 +0000</pubDate>
      <link>https://dev.to/missyneon/openpyxl-wont-load-excel-fill-with-blue-style-fill-in-cells-2213</link>
      <guid>https://dev.to/missyneon/openpyxl-wont-load-excel-fill-with-blue-style-fill-in-cells-2213</guid>
      <description>&lt;p&gt;I wrote a python script to load an excel file with blue style fill in the excel sheet (blue color background in cells) and the load_workbook function keeps failing with the error below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wb = load_workbook(excel file)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Programs\Python\Python311\Lib\site-packages\openpyxl\reader\excel.py", line 346, in load_workbook
    reader.read()
  File "C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Programs\Python\Python311\Lib\site-packages\openpyxl\reader\excel.py", line 299, in read
    apply_stylesheet(self.archive, self.wb)
  File "C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Programs\Python\Python311\Lib\site-packages\openpyxl\styles\stylesheet.py", line 198, in apply_stylesheet
    stylesheet = Stylesheet.from_tree(node)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Programs\Python\Python311\Lib\site-packages\openpyxl\styles\stylesheet.py", line 103, in from_tree
    return super(Stylesheet, cls).from_tree(node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Programs\Python\Python311\Lib\site-packages\openpyxl\descriptors\serialisable.py", line 103, in from_tree
    return cls(**attrib)
           ^^^^^^^^^^^^^
  File "C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Programs\Python\Python311\Lib\site-packages\openpyxl\styles\stylesheet.py", line 74, in __init__
    self.fills = fills
    ^^^^^^^^^^
  File "C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Programs\Python\Python311\Lib\site-packages\openpyxl\descriptors\sequence.py", line 27, in __set__
    seq = self.container(_convert(self.expected_type, value) for value in seq)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Programs\Python\Python311\Lib\site-packages\openpyxl\descriptors\sequence.py", line 27, in &amp;lt;genexpr&amp;gt;
    seq = self.container(_convert(self.expected_type, value) for value in seq)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\&amp;lt;username&amp;gt;\AppData\Local\Programs\Python\Python311\Lib\site-packages\openpyxl\descriptors\base.py", line 61, in _convert
    raise TypeError('expected ' + str(expected_type))
TypeError: expected &amp;lt;class 'openpyxl.styles.fills.Fill'&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How do I fix this error using python? Thank you!&lt;/p&gt;

</description>
      <category>openpyxl</category>
    </item>
  </channel>
</rss>
