Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Description

Excerpt

Inserts a new worksheet into the workbook at a specified position.

Signature
C#
C#
 public Worksheet InsertSheet(System.String name, int position)
{signature}{signature:
}
Signature
vb.net
vb.net
Public Function InsertSheet(ByVal name As String, ByVal position As Integer) As Worksheet
{signature}
{parameters}
{param:name}The name of the sheet to create and insert.{param}
{param:position}The 0\-based position at which to insert the worksheet. If {{position}} is less than 0, it is inserted before the first sheet in the workbook. If {{position}} is equal to or greater than [Worksheets.Count|Worksheets.Count], it is inserted after the last worksheet.{param}
{returns}A [Worksheet|Worksheet] object representing the inserted worksheet.{returns}
{example}{code:csharp|title=C#}
Parameters
Param
name
name

The name of the sheet to create and insert.

Param
position
position

The 0-based position at which to insert the worksheet. If position is less than 0, it is inserted before the first sheet in the workbook. If position is equal to or greater than Worksheets.Count, it is inserted after the last worksheet.

Returns

A Worksheet object representing the inserted worksheet.

Example
Code Block
csharp
csharp
titleC#

sheets.InsertSheet("NewSheet", 1);
{code} {code:
Code Block
vb.net
|title=
vb.net
titlevb.net
}

sheets.InsertSheet("NewSheet", 1)
{code} {example}