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.

Try ByteScout Spreadsheet SDK today: Get 60 Day Free Trial or sign up for Web API

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

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

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout Spreadsheet SDK page

Explore ByteScout Spreadsheet SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next