I am making an excel comparing program but I seem to be stuck. I want to compare two excel files in a spreadsheet. Here is my code:
import openpyxl
wb = openpyxl.load_workbook('C:\\Users\\Bill\\Desktop\\CK_Server_list_0.1.xlsx')
ws = wb.active
wb1 =
openpyxl.load_workbook('C:\\Users\\Bill\\Desktop\\CK_Server_list_0.2.xlsx')
ws1 = wb1.active
for x in ws.iter_cols(max_col=1):
for cell in x:
print(cell.value, cell.coordinate)
for row1 in ws1.iter_cols(min_col=1):
if row1[0].value != ws.cell(row=x, column=1).value:
print(str(row1[0].value) + ' is not equal to ' + str(ws.cell(row=x, column=1).value + ' ' + str(ws.cell(row=x, column=1).coordinate)))
And every time I run this it gives me an error saying that tuple() < int()
. Can anyone fix this problem? Any help would be appreciated.