[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ITableStyle.Duplicate

Duplicate Method

Duplicate(string)

Returns a duplicate of this ITableStyle object with the specified name.

If newName is null, this method forwards the current style name to the duplication logic. If the specified name already exists, a valid style name is generated for the new copy.

Declaration
ITableStyle Duplicate(string newName = null)
Function Duplicate(Optional newName As String = Nothing) As ITableStyle
Parameters
Type Name Description
string newName

The name of the new table style. May be null.

Returns
Type Description
ITableStyle

A copy of the ITableStyle object with the specified name.

Examples
ITableStyle sourceStyle = workbook.TableStyles["TableStyleLight11"];
ITableStyle copiedStyle = sourceStyle.Duplicate("CustomLightStyle");
worksheet.Range["A1:B3"].Value = new object[,] {
    {"Name", "Value"},
    {"Test", 100}
};
worksheet.Tables.Add(worksheet.Range["A1:B3"], true).TableStyle = copiedStyle;