Version

Add(String,SheetType) Method

Creates a new Sheet and adds it to the collection.
Syntax
'Declaration
 
Public Function Add( _
   ByVal name As String, _
   ByVal type As SheetType _
) As Sheet
public Sheet Add( 
   string name,
   SheetType type
)

Parameters

name
The name to give the new Sheet.
type
An enumeration indicating the type of sheet to create

Return Value

The Sheet created with the specified name.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionname is null or empty.
System.ArgumentExceptionname contains the invalid characters: ':', '\', '/', '?', '*', '[', or ']'.
System.ArgumentExceptionname exceeds 31 characters in length.
System.ArgumentExceptionname is being used as the name of another sheet (sheet names are case-insensitively compared).
Remarks

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

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also