Openpyxl - Writing from dictionary to excel rows and columns
<p>So what im trying to do is writing to an existing excel-file from a dictionary:</p>

<pre><code>wb = load_workbook(filename='test.xlsx')
ws2 = wb.get_sheet_by_name("Blad3")
tuple(ws2.iter_rows('A2:I1000'))
for i in ws2.iter_rows('A2:I1000'):
    print str(row[0].value)
    for i in Candidates:
        row[0].value = i['Start Location']
        row[1].value = i['Distance']
        row[2].value = i['End Location']
    for p in Potential_candidates:
        row[4].value = p['Start Location']
        row[5].value = p['Distance']
        row[6].value = p['End Location']
    for n in No_coords:
        row[8].value = No_coords
print 'Saving to file "test.xlsx"'
wb.save('test.xlsx')
</code></pre>

<p>the "print str(row[0].value)" get the correct value from the worksheet, but when i instead try to set the value it says:
TypeError: 'NoneType' object has no attribute '<strong>getitem</strong>'.</p>

<p>The error occurs at row[0].value = i['Start Location']</p>

<p>Ive been trying to figure out why and either ive just missed the most obvious thing or im completely lost. Shouldnt you be able to write to the cell if you 
can read from it?</p>

<p>So i figured out what was wrong with the NoneType error, apparently the list had a None element at [0]. 
So i added a function to remove such elements from all the lists and now i have a new error:</p>

<p>TypeError: 'tuple' object does not support item assignment</p>