Introduction
In this topic, we will discuss that how can we change the name of a worksheet using Aspose.Grid.Desktop. Changing the name of a worksheet is a quite handy task whose importance and usage will be explained in the rest of our discussion.
Renaming a Worksheet
Renaming a worksheet is a simplest task but it can be useful for you in many cases. For example, when you have many worksheets and just want to label each worksheet so that you may recognize them easily. As a simplest example, for your whole financial year, you can have 12 worksheets (each named as a month name) to contain the expenses information of each month. Well, now you can imagine that it's simple but still a powerful feature to make your life easier.
To rename a worksheet using Aspose.Grid.Desktop control, please follow the steps below:
- Add Aspose.Grid.Desktop control to your Form
- Get the reference of a desired Worksheet
- Set the Name of the Worksheet using its reference
NOTE: Before changing the name of the worksheet, it's required to access the reference of that Worksheet. There are many ways to access the reference of a Worksheet. To learn about those ways, please refer to Accessing Worksheets
Example:
[C#]
//Accesing an active worksheet directly
Worksheet sheet = gridDesktop1.GetActiveWorksheet();
//Renaming a worksheet
sheet.Name = "Renamed Sheet";
[VB.NET]
'Accesing an active worksheet directly
Dim sheet As Worksheet = gridDesktop1.GetActiveWorksheet()
'Renaming a worksheet
sheet.Name = "Renamed Sheet"
Describes how to access a worksheet using Aspose.Grid.Desktop.
8/16/2006 5:01:57 AM - -210.56.19.13