Occurs when a worksheet is about to be renamed.
The SheetRenaming event's data class is SheetRenamingEventArgs. The following properties provide information specific to this event:
|Cancel||Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.|
|NewName||Gets or sets the new name of the renamed worksheet.|
|OldName||Gets the name of the worksheet being renamed.|
The SheetRenaming event allows you to perform an action before a worksheet is renamed using the Worksheet.Name property. You can cancel renaming a worksheet by setting the event parameter’s Cancel property to true.
After a worksheet name has been changed, the Workbook.SheetRenamed event is raised.
This event does not occur by default. The event fires only if the WorkbookEventOptions.RaiseOnModificationsViaAPI property is true.