Home

Bytescout.XLS for .NET
Screenshots

Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample
Click to view sample Click to view sample

Bytescout.XLS library for .NET

Download Free Trial Buy Now More Information

How to add rows to an existing Excel (XLS) document using Bytescout.XLS library

This source code sample teaching how to add rows with data to an existing XLS document using Bytescout.XLS lib

Download example source code: bytescoutxls_adding_rows_into_existing_xls.zip (5 KB)

Source Excel document:

Source Excel document (XLS)

New row was inserted and document saved as new document file:

Modified Excel document with new row inserted

using System;
using System.Collections.Generic;
using System.Text;
using Bytescout.XLS;

namespace Adding_rows_to_existing_XLS
{
class Program
{
static void Main(string[] args)
{
// Open XLSDocument
XLSDocument document = new XLSDocument("AdvancedReport.xls");
// Get Worksheet
Worksheet worksheet = document.WorkBook.Worksheets[0];
// Add new row
worksheet.Rows.Insert(6, 1);
// Set values
worksheet.Rows[6][0].Value = "New Name";
worksheet.Rows[6][1].Value = "New Full Name";
// Save document
document.SaveAs("AdvancedReport1.xls");
// Close XLSDocument
document.Close();
}
}
}

Download example source code: bytescoutxls_adding_rows_into_existing_xls.zip (5 KB)

Download Free Trial Buy Now More Information

Documentation online: view (separate window)

First steps tutorials:

Advanced Examples:
Products  |  Download  |  Purchase  |  Support  |  Contacts  |  Testimonials |  

ByteScout, 2003-2008. All other company and product names may be trademarks of their respective companies. Privacy Statement