I am trying to modify one existing excel sheet in a loop based on different conditions. However I am getting Excel Alert message for all the very second time and not able to modify the excel. I have used the Microsoft.office.Interop.Excel component.
Attached is my code, please suggest me as soon as possible. This is very urgent and I am struggling a lot.
Microsoft.Office.Interop.Excel.
Microsoft.Office.Interop.Excel.
Microsoft.Office.Interop.Excel.
Microsoft.Office.Interop.Excel.
{
xlApp =
xlWorkBook = xlApp.Workbooks.Open
(
{
{
xlWorkSheet = (Microsoft.Office.Interop.Excel.
range = xlWorkSheet.UsedRange;
range.SpecialCells(
startRow = xlApp.ActiveCell.Row + 1;
xlWorkSheet.Cells[startRow, 3] = strDate;
xlWorkSheet.Cells[startRow, 4] = strOrder;
xlWorkSheet.Cells[startRow, 5] = strState;
xlWorkSheet.Cells[startRow, 6] = strCounty;
xlWorkSheet.Cells[startRow, 7] = strBorrower;
xlWorkSheet.Cells[startRow, 8] = strOrderType;
xlApp.Save(xlWorkBook);
xlWorkBook.Close(
releaseObject(range);
releaseObject(xlWorkSheet);
releaseObject(xlWorkBook);
xlApp.Quit();
releaseObject(xlApp);
}
}
}
{
}
{
}
Thanks in Advance.
Suthish NairPosted Feb 22, 2011, 11:55 AM