I agree with you, Ian. Thanks for all the help. Now I get the below error. File "test.py", line 17, in <module> total = sum(float(col.value) for r in iter(next_r, None) for col in r[0].columns.itervalues()) File "test.py", line 17, in <genexpr> total = sum(float(col.value) for r in iter(next_r, None) for col in r[0].columns.itervalues()) Thanks