[]
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.
ITableStyle Duplicate(string newName = null)
Function Duplicate(Optional newName As String = Nothing) As ITableStyle
| Type | Name | Description |
|---|---|---|
| string | newName | The name of the new table style. May be |
| Type | Description |
|---|---|
| ITableStyle | A copy of the ITableStyle object with the specified name. |
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;