[]
Creates a custom view from the current workbook view state.
The custom view captures the current view state of all worksheets in the workbook. If a custom view with the same name already exists, the existing custom view is replaced. A custom view cannot be added while the workbook contains a table or a pivot table.
ICustomView Add(string viewName, bool printSettings, bool rowColSettings)
Function Add(viewName As String, printSettings As Boolean, rowColSettings As Boolean) As ICustomView
| Type | Name | Description |
|---|---|---|
| string | viewName | The name of the custom view. Must not be |
| bool | printSettings | true to include print settings in the custom view; otherwise, false. |
| bool | rowColSettings | true to include hidden row and column settings, including filter information, in the custom view; otherwise, false. |
| Type | Description |
|---|---|
| ICustomView | The newly created custom view. |
ICustomView customView = workbook.CustomViews.Add("PrintView", true, false);
| Type | Condition |
|---|---|
| ArgumentException | Thrown when |