Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have the range value that contains used range values of excel sheet, now I cant insert row at end of the range area

C#
static public void SpreedsheetOpen(string ExcelFile)
    {
        xlApp = new Excel.Application();
        xlApp.Visible = false;
        xlWorkBook = xlApp.Workbooks.Open(ExcelFile, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
        xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
        xlRange = xlWorkSheet.UsedRange;        
    }


in this xlRange=xlWorkSheet.UsedRange; I get the xl sheet used range value in range object how to insert new row at end of this range.
Posted
Comments
Kenneth Haugland 7-May-15 3:08am    
http://stackoverflow.com/questions/10752971/first-blank-row-in-excel

1 solution

First of all, there is no need to add/insert new row, because a set of rows and columns already exists! All you have to do is to find first blank row, as Keneth Haugland[^] mentioned in the comment to the question.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900