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

Nishant MittalRank #692 · 3.5K reputationPosted Jan 7, 2016, 11:47 PM EST
kumar yoga156 reputationPosted Jan 7, 2016, 11:56 PM EST
Prem Anandh JRank #8,962 · 213 reputationPosted Jan 8, 2016, 12:18 AM EST
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 yoga156 reputationPosted Jan 8, 2016, 1:19 AM EST
kumar yoga156 reputationPosted Jan 8, 2016, 1:25 AM EST
Rajeesh MenothRank #118 · 18.4K reputationPosted Jan 8, 2016, 5:28 PM EST