Infragistics(R) NetAdvantage(R) WPF
Add Method
See Also  E-mail your feedback on this topic.
Infragistics.Documents.Excel Namespace > WorksheetCollection Class : Add Method

name
The name to give the new Worksheet.
Creates a new Worksheet and adds it to the collection.

Syntax

Visual Basic (Declaration) 
Public Function Add( _
   ByVal name As String _
) As Worksheet
C# 
public Worksheet Add( 
   string name
)

Parameters

name
The name to give the new Worksheet.

Return Value

The Worksheet created with the specified name.

Exceptions

ExceptionDescription
System.ArgumentNullException is null or empty.
System.ArgumentException contains the invalid characters: ':', '\', '/', '?', '*', '[', or ']'.
System.ArgumentException exceeds 31 characters in length.
System.ArgumentException is being used as the name of another worksheet (worksheet names are case-insensitively compared).

Remarks

If the workbook originally had no worksheets, the newly added worksheet will become the selected worksheet of the workbook. This can be changed after more worksheets are added by setting the WindowOptions.SelectedWorksheet of the Workbook.

See Also