- Home
- Purchase
- Developer Tools
- BarCode Generator SDK
- BarCode Generator SDK for Javascript for Code 128
- BarCode Reader SDK
- PDF Generator SDK for Javascript
- PDF Extractor SDK
- PDF Renderer SDK
- PDF To HTML SDK
- PDF Viewer SDK
- Spreadsheet SDK
- Image To Video SDK
- Screen Video Capturing SDK
- SWF To Video and Images SDK
- Images Watermarking SDK
- Document SDK beta
- Misc Tools
- Desktop Utilities
- Download
- Support
- Company
Adding new columns to an existing Excel XLS document using Bytescout Spreadsheet SDK
Adding new columns with data to an existing Excel document using Bytescout Spreadsheet SDK
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:

Modified document (new column was added):

using System;
using System.Collections.Generic;
using System.Text;
using Bytescout.Spreadsheet;
namespace Adding_columns_into_existing_XLS
{
class Program
{
static void Main(string[] args)
{
// Open Spreadsheet
Spreadsheet document = new Spreadsheet("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 Spreadsheet
document.Close();
}
}
}
Download example source code: bytescoutxls_adding_columns_into_existing_xls.zip (5 KB)
Filed in:
Spreadsheet SDK
Tutorials:









