kesav venu gopal g

I am using the following to compare data in an excel and update the contents.

Excel.Application fExcelApp = new Excel.ApplicationClass();

Excel.Workbook fWBook = null;

Excel.Worksheet fWorkSheet2 = null;

string strFsBatchTemplate = HttpContext.Current.Server.MapPath(@"Excel\2.xls");

string strFsRollUpFile = HttpContext.Current.Server.MapPath(@"Excel\1.xls");

if (File.Exists(strFsRollUpFile))

{

File.Delete(strFsRollUpFile);

}

File.Copy(strFsBatchTemplate, strFsRollUpFile, true);

fWBook = (Excel.Workbook)(fExcelApp.Workbooks.Open(strFsRollUpFile, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing));

fWorkSheet2 = (Excel.Worksheet)fWBook.ActiveSheet;

for(int i=0;i<50;i++)

{

if (fWorkSheet2.Cells[i,1]="A")

{

fWorkSheet2.Cells[i,4]="100";

}

}

In the above code when i am trying to compare its giving me an exception : Exception from HRESULT: 0x800A03EC.

Please help in this regard.

Thanks

Venu