How to rename a worksheet in existing spreadsheet (Excel XLS) using Bytescout Spreadsheet SDK

This source code sample demonstrates how to rename workshett in existing XLS document file using Bytescout Spreadsheet SDK for .NET

Download example source code: (8 KB)

Screenshot of the spreadsheet with renamed worksheet (first worksheet was renamed from “Sheet1” into “Collected Data Sheet”):

Renamed worksheet in existing XLS spreadshett

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

namespace HelloWorld
class Program
static void Main(string[] args)
// Create new Spreadsheet
Spreadsheet document = new Spreadsheet(“Data.xls”);

// Get worksheet by name
Worksheet worksheet = document.Workbook.Worksheets.ByName(“Sheet1”);

// Set new worksheet name
worksheet.Name = “Collected Data Sheet”;

// Save document

// Close document

// open generated XLS document in default program

Download example source code: (8 KB)