I done it.
Microsoft.Office.Interop.Excel.ApplicationClass clsExcel = null;
Microsoft.Office.Interop.Excel.Workbook clsWorkbook = null;
Microsoft.Office.Interop.Excel.Worksheet clsWorksheet = null;
// open the template...
clsExcel = new Microsoft.Office.Interop.Excel.ApplicationClass();
clsExcel.Visible = false;
clsWorkbook = clsExcel.Workbooks.Open("C:\mySpreadsheet.xls", 2, false, 5,
"", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindow s, "", false,
true, 0, false, true,
Microsoft.Office.Interop.Excel.XlCorruptLoad.xlNor malLoad);
// get worksheet...
clsWorksheet =
((Microsoft.Office.Interop.Excel.Worksheet)clsWork book.Worksheets);
clsWorksheet.get_Range("A1", "A1").EntireRow.Delete();
// save...
clsWorkbook.Save();
clsWorkbook.Close(false, "", false);
// release...
clsExcel.Quit();
Thank you very much.
"Subhash" wrote:
Pls be clear in your question..Pls let us know how you work with the excel
file ?
"B.N.Prabhu" <BN******@discussions.microsoft.comwrote in message
news:25**********************************@microsof t.com...
How to delete first row from an Excel Sheet using C#.Net. Please Help. Its
very urgent.