When I will Rerun the file it will get error like following
<p>IndexError: list index out of range.</p>

<p>my code is :</p>

<pre><code>from openpyxl import load_workbook
from common.log import logging

class TestData:
    def get_data(self):

        wb = load_workbook(filename="demo.xlsx")
        ws = wb.active
        ws['A2'] = "ammy"
        ws['A3'] = "raju"
        ws['B2'] = 50
        ws['B3'] = 60
        ws['A4'] = "Total2"
        ws['B4'] = ("=SUM(B2:B3)")
        wb.save('demo.xlsx')


if __name__=='__main__':
    print "start"
    obj = TestData()
    obj.get_data()
    print "end"
</code></pre>

<pre><code>start
Traceback (most recent call last):
  File "/home/amol.pawar/Globeflexresearch/gri/gri-be/scripts/xlsxdata.py", line 41, in &lt;module&gt;
    obj.get_data()
  File "/home/amol.pawar/Globeflexresearch/gri/gri-be/scripts/xlsxdata.py", line 23, in get_data
    wb = load_workbook(filename="demo.xlsx")
  File "/usr/local/lib/python2.7/dist-packages/openpyxl/reader/excel.py", line 201, in load_workbook
    apply_stylesheet(archive, wb) # bind styles to workbook
  File "/usr/local/lib/python2.7/dist-packages/openpyxl/styles/stylesheet.py", line 164, in apply_stylesheet
    stylesheet = Stylesheet.from_tree(node)
  File "/usr/local/lib/python2.7/dist-packages/openpyxl/styles/stylesheet.py", line 99, in from_tree
    return  super(Stylesheet, cls).from_tree(node)
  File "/usr/local/lib/python2.7/dist-packages/openpyxl/descriptors/serialisable.py", line 89, in from_tree
    return cls(**attrib)
  File "/usr/local/lib/python2.7/dist-packages/openpyxl/styles/stylesheet.py", line 90, in __init__
    self.named_styles =  self._merge_named_styles()
  File "/usr/local/lib/python2.7/dist-packages/openpyxl/styles/stylesheet.py", line 110, in _merge_named_styles
    xf = self.cellStyleXfs[style.xfId]
  File "/usr/local/lib/python2.7/dist-packages/openpyxl/styles/cell_style.py", line 182, in __getitem__
    return self.xf[idx]
IndexError: list index out of range
</code></pre>

python openpyxl