ByteScout Spreadsheet SDK - C# - Add Columns Into Existing Spreadsheet - ByteScout

ByteScout Spreadsheet SDK – C# – Add Columns Into Existing Spreadsheet

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Add Columns Into Existing Spreadsheet

How to add columns into existing spreadsheet in C# with ByteScout Spreadsheet SDK

Write code in C# to add columns into existing spreadsheet with this step-by-step tutorial

Learn how to add columns into existing spreadsheet in C# with this source code sample. ByteScout Spreadsheet SDK is the SDK component for writing, reading, modifying and calculating Excel and CSV spreadsheets. Can calculate and reculculate formulas with Excel installed. You may import or export data to and from CSV, XML, JSON. Supports export to databases, arrays, streams and you can use it to add columns into existing spreadsheet with C#.

You will save a lot of time on writing and testing code as you may just take the C# code from ByteScout Spreadsheet SDK for add columns into existing spreadsheet below and use it in your application. Follow the instructions from the scratch to work and copy the C# code. Enjoy writing a code with ready-to-use sample C# codes.

ByteScout free trial version is available for download from our website. It includes all these programming tutorials along with source code samples.

Try ByteScout Spreadsheet SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

Program.cs
      
using System; using System.Collections.Generic; using System.Text; using Bytescout.Spreadsheet; using System.Diagnostics; using System.IO; namespace Adding_columns_into_existing_XLS { class Program { static void Main(string[] args) { // Open Spreadsheet Spreadsheet document = new Spreadsheet(); document.LoadFromFile("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"; // delete output file if exists already if (File.Exists("Output.xls")){ File.Delete("Output.xls"); } // Save document document.SaveAs("Output.xls"); // Close Spreadsheet document.Close(); // open generated XLS document in default program Process.Start("Output.xls"); } } }

Try ByteScout Spreadsheet SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

VIDEO

ON-PREMISE VERSION INFORMATION

Get 60 Day Free Trial or Visit ByteScout Spreadsheet SDK Home Page

Explore ByteScout Spreadsheet SDK Documentation

Get ByteScout Spreadsheet SDK Free Training

WEB API

Get Your Free API Key

Explore Web API Documentation

Tutorials:

prev
next