How to change cell value in existing XLS document using Bytescout Spreadsheet - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

How to change cell value in existing XLS document using Bytescout Spreadsheet

  • Home
  • /
  • Articles
  • /
  • How to change cell value in existing XLS document using Bytescout Spreadsheet

How to change data in an existing Excel (XLS) document using Bytescout Spreadsheet SDK

This source code sample demonstrates how to use Bytescout Spreadsheet SDK to change data in an existing Excel (.XLS) document and save changed file as a new one.

Download example source code: bytescoutxls_changing_data_in_existing_xls.zip (8 KB)

Source document screenshot:

source Excel document with data table

Modified document screenshot (see Homer’s Full Name changed)

using System;
using System.Collections.Generic;
using System.Text;
using Bytescout.Spreadsheet;

namespace Changing_data_in_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];
// Set cell value
worksheet.Cell(1, 1).Value = “Homer Jay Simpson 2”;
// Save document
document.SaveAs(“AdvancedReport1.xls”);
// Close Spreadsheet
document.Close();
}
}
}

Download example source code: bytescoutxls_changing_data_in_existing_xls.zip (8 KB)

Tutorials:

prev
next