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

Adding new columns with data to an existing Excel document using Bytescout.XLS library

This short sample demonstrates how to take an existing document and add new columns with data to this document and then save as new document

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

Source Excel document:

Source Excel document

Modified document (new column was added):

New document generated from existing by adding new column

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

namespace Adding_columns_into_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 Column
worksheet.Columns.Insert(3, 1);
// Set values
worksheet.Rows[0][2].Value = "Age";
// Save document
document.SaveAs("AdvancedReport1.xls");
// Close XLSDocument
document.Close();
}
}
}

Download example source code: bytescoutxls_adding_columns_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