How to compare the content of each cell in two different excel files

Dear all,
I have two excel files(book1 and book2), i want to compare the two excel files cell by cell, if each cell of the two excel files are the same, then write line "the two excel files are the same ". If find the different cell content of each excel file, color the cell then write line "the two excel files are the different " .
we could attention that the number of row in each two excel files could be modified ( it may be increased or decreased )
how could i achieve the function, anybody could give me some domo code or guides ? thanks a lot in advance .

1 Like

Fine
To be very simple, lets compare it to whole as either one cell doent’ match or whole table doesn’t match both implies the same – doesn’t matct.
–use a excel application scope and pass the file path as input
–use read range and get the output with a variable of type datatable named dt1
–do the same get for second excel and get the datatable named dt2
–use output datatable activity and pass dt1 as input and get the output as a string variable named out_dt1string
–same with dt2 and get the output like out_dt2string
now use a if condition and mention like
out_dt1string.ToString.Equals(out_dt2string.ToString)
if true will go to THEN part where use a message box activity like “matches” or in ELSE part mention as “doesn’t matches” in message box activity

hope this would help you
Cheers @Chris-Yiwei

thanks a lot for your reply, could you give me the demo code ?

1 Like

here you go
hope this would help you
matches.zip (2.4 KB)

Cheers @Chris-Yiwei

yes, it works!

however, another question, if there are differences in two excel files , how could find the different cell in book1 excel file then color the cell ?

could you give me the tips?

thanks a lot in advance