ByteScout Spreadsheet SDK - C# - Copy Range - ByteScout

ByteScout Spreadsheet SDK – C# – Copy Range

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Copy Range

How to copy range in C# using ByteScout Spreadsheet SDK

How to code in C# to copy range with this step-by-step tutorial

Learn how to copy range in C# with this source code sample. ByteScout Spreadsheet SDK is the library (SDK) that is capable of writing, reading, modifying and calculating Excel and CSV spreadsheets. Most popular formulas can be calculated and reculculated with Excel installed. You may import or export data to and from CSV, XML, JSON as well as to and from databases, arrays. It can copy range in C#.

This code snippet below for ByteScout Spreadsheet SDK works best when you need to quickly copy range in your C# application. Just copy and paste the code into your C# application’s code and follow the instruction. Implementing C# application typically includes multiple stages of the software development so even if the functionality works please test it with your data and the production environment.

Trial version of ByteScout Spreadsheet SDK is available for free. Source code samples are included to help you with your C# app.

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.Diagnostics; using System.IO; using Bytescout.Spreadsheet; namespace CopyRange { class Program { static void Main(string[] args) { // Open spreadsheet from file Spreadsheet document = new Spreadsheet(); document.LoadFromFile("example.xls"); // Get first worksheet Worksheet worksheet = document.Workbook.Worksheets[0]; // Select cell range Range range = worksheet.Range("A2:B8"); // Copy range to C10 cell range.CopyInto("C10"); // Delete output file if exists if (File.Exists("changed.xls")) { File.Delete("changed.xls"); } // Save document document.SaveAs("changed.xls"); // Close spreadsheet document.Close(); // Open generated XLS document in default program Process.Start("changed.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