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.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

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"); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Spreadsheet SDK Home Page

Explore ByteScout Spreadsheet SDK Documentation

Explore Samples

Sign Up for ByteScout Spreadsheet SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Spreadsheet SDK Home Page

Explore ByteScout Spreadsheet SDK Documentation

Explore Samples

Sign Up for ByteScout Spreadsheet SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next