Compare Excel Cell Styles
Posted on 2008-10-10
VB2005, Excel 2007
I'm creating a VB.NET application that compares the contents of two Excel worksheets on a cell by cell basis. I have not problem doing things like comparing values, formulas, number formats, etc. What I want to be able to compare that the formatting on two cells is exactly the same.
What I have done so far is create an Excel style variable for each cell.
Dim ws1Style As Excel.Style = Worksheet1.Cells(r, c).style
Dim ws2Style As Excel.Style = Worksheet2.Cells(r, c).style
What I want to do now is determine if the two styles are exactly the same. How can I do this?