473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 30105

"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 specific library in AS400 DB2 using AS400...
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 to me by technology manager) of the server and...
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 the previous day's data, it appends rather than...
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 excel sheet, the approach i have used is to get...
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 delete rows where the first column starts with a...
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 have identical versions of Win XP (SP1) and Excel...
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 cell other than A. An unhandled exception of...
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 Excel.Worksheet xWorkbook =...
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 =__T() I am not able to set a value to a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.