Remove rows with data from existing Excel (.XLS) document using Bytescout Spreadsheet SDK - Sample source code - 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!

Remove rows with data from existing Excel (.XLS) document using Bytescout Spreadsheet SDK – Sample source code

  • Home
  • /
  • Articles
  • /
  • Remove rows with data from existing Excel (.XLS) document using Bytescout Spreadsheet SDK – Sample source code

How to remove rows from existing XLS (Excel) document using Bytescout Spreadsheet SDK

This source code describes how to remove rows from existing Excel (XLS) document and save changed document as new document file using Bytescout Spreadsheet lib

Source Excel document:

Source Excel document

Modified Excel document (row with Maggie name and full name was removed):

Modified Excel document

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

namespace Removing_rows_from_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];
// Remove row
worksheet.Rows.Delete(5, 5);
// Save document
document.SaveAs(“AdvancedReport1.xls”);
// Close Spreadsheet
document.Close();
}
}
}

Tutorials:

prev
next