Skip to content
Advertisement

error in row or column number python openpyxl

Error trace :’python openpyxl row or column value must be at at least 1′

I’m attempting to use Python to extract data and write it to an Excel spreadsheet.

it gives me an error that row and column values must be at least 1. Though they are not by initialize value equal to 0, I add them by 1 and the error persists.

code is below;

JavaScript

Advertisement

Answer

I guess you’ve got this error here:

JavaScript

When d equals zero I expect to see an error at ws.cell(row=d, ...) because rows and columns in Excel are numbered starting from 1. Sort of ws.cell(row=d+1, ...) should help.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement