Learn how to rename worksheet in VB.NET with this source code sample. ByteScout Spreadsheet SDK can rename worksheet. It can be used from VB.NET. ByteScout Spreadsheet SDK is the SDK to create, read, modify and calculate spreadsheets. Formula calculations are supported, import and export to and from JSON, CSV, XML, databases, arrays.
This code snippet below for ByteScout Spreadsheet SDK works best when you need to quickly rename worksheet in your VB.NET application. Follow the instructions from the scratch to work and copy the VB.NET code. Detailed tutorials and documentation are available along with installed ByteScout Spreadsheet SDK if you’d like to dive deeper into the topic and the details of the API.
Trial version of ByteScout Spreadsheet SDK can be downloaded for free from our website. It also includes source code samples for VB.NET and other programming languages.
Imports Bytescout.Spreadsheet Imports System.IO Module Module1 Sub Main() ' Create new Spreadsheet Dim document As New Spreadsheet() document.LoadFromFile("Data.xls") ' Get worksheet by name Dim worksheet As Worksheet = document.Workbook.Worksheets.ByName("Sheet1") ' Set new worksheet name worksheet.Name = "Collected Data Sheet" ' remove output file if already exists If File.Exists("Output.xls") Then File.Delete("Output.xls") End If ' Save document document.SaveAs("Output.xls") ' Close Spreadsheet document.Close() ' open in default spreadsheets viewer/editor Process.Start("Output.xls") End Sub End Module