how to compare two excel file . the excel cell is based and highlight the difference.
example
excle file sheet1
cell1
red
green
yellow
cell2
green
black
yellow
excle file sheet2
cell1
red
green
Black
cell2
green
red
yellow
compare two sheet and highlight the difference
o/p
excle file sheet2
cell1
red
green
Black
cell2
green
red
yellow
Rajeesh MenothPosted Jan 8, 2016, 10:28 PM
kumar yogaPosted Jan 8, 2016, 6:25 AM
kumar yogaPosted Jan 8, 2016, 6:19 AM
Prem Anandh JPosted Jan 8, 2016, 5:18 AM
if (result == DialogResult.OK)
{
try
{
Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook workBook = excel.Workbooks.Open(openFileDialog1.FileNames[0].ToString());
Microsoft.Office.Interop.Excel.Worksheet sheet = workBook.Worksheets.get_Item(1);// .ActiveSheet;
Microsoft.Office.Interop.Excel.Range range = sheet.UsedRange;
string address = range.get_Address();
//string[] cells = address.Split(new char[] { ':' });
//string beginCell = cells[0].Replace("$", "");
//string endCell = cells[1].Replace("$", "");
//int lastColumn = range.Columns.Count;
int lastRow = range.Rows.Count;
// MessageBox.Show("Col "+lastColumn+", Row"+ lastRow);
workBook.Close(true);
excel.Quit();
}
catch (Exception ex)
{
MessageBox.Show(ex.toString());
}
}
kumar yogaPosted Jan 8, 2016, 4:56 AM
Nishant MittalPosted Jan 8, 2016, 4:47 AM