472,328 Members | 1,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

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
4 29903

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Niyazi | last post by:
Hi, I have to retrieve a data from AS400 DB2 and after working with data I have to export into one of existing Excel file. I can connect into...
5
by: Rajiv | last post by:
HI ALL, actually , i m working in a company having large number of employee , i have two userid and password . on id is from admin group(id given...
1
by: smonczka | last post by:
I have a DTS package that needs to refresh data in 3 separate Excel spreadsheets on a daily basis. The problem is that unless I manually delete...
1
by: Vivek | last post by:
Hi all, I am trying to import data from an excel sheet to MSSQL server 2000 using a web application (C#). Since I have to validate the data in the...
1
by: richilli | last post by:
Hi Any help on this would be appreciated cos its driving me insane. I have a function in VB.NET that takes in an excel range and tries to...
3
by: | last post by:
I wrote a class in VB.NET to export the contents of a datagrid to Excel. It works perfectly on my machine, but it fails on my customers' PCs that...
3
by: krallabandi | last post by:
Hi, I am trying to generate Excel sheet using Provider=Microsoft.Jet.OLEDB.4.0; I am always getting the error while inserting data into any...
2
by: Bas | last post by:
I',m trying to delete a named worksheet - what's wrong with this?? xlApp = New Excel.Application() Dim xWorkbook As Excel.Workbook Dim PageSht As...
18
by: Frank M. Walter | last post by:
Hello, I have made an small AddIn with udf for excel 2003. I use vs2003. The point of view is the function __T() I call it in excel sheet writing...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.