467,145 Members | 1,004 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,145 developers. It's quick & easy.

How to delete first row from an Excel Sheet using C#.Net

How to delete first row from an Excel Sheet using C#.Net. Please Help. Its
very urgent.
Aug 4 '06 #1
  • viewed: 28753
Share:
4 Replies

"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.

Aug 5 '06 #2

"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.

Aug 5 '06 #3
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.

Aug 5 '06 #4
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.


Aug 7 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Rajiv | last post: by
1 post views Thread by smonczka@hotmail.com | last post: by
3 posts views Thread by krallabandi@gmail.com | last post: by
2 posts views Thread by Bas | last post: by
18 posts views Thread by Frank M. Walter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.