Worksheet.Next Property (2007 System)

Gets a Worksheet that represents the next sheet.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)


<BrowsableAttribute(False)> _
Public ReadOnly Property Next As Object
Dim instance As Worksheet 
Dim value As Object 

value = instance.Next
public Object Next { get; }
property Object^ Next {
    Object^ get ();
public function get Next () : Object

Property Value

Type: System.Object
A Worksheet that represents the next sheet; nulla null reference (Nothing in Visual Basic) if the current worksheet is the last sheet in the workbook.


The following code example uses the Next property to determine whether the current Worksheet is the last sheet in the workbook. If the current Worksheet is not the last sheet, then the name of the next sheet is displayed.

This example is for a document-level customization.

Private Sub DisplayNextWorksheet()
    If Not (Me.Next Is Nothing) Then 
        Dim nextSheet As Excel.Worksheet = _
            CType(Me.Next, Excel.Worksheet)
        MsgBox("The next worksheet is " & nextSheet.Name)
        MsgBox("This worksheet is the last worksheet.")
    End If 
End Sub
private void DisplayNextWorksheet()
    if (this.Next != null)
        Excel.Worksheet nextSheet = (Excel.Worksheet)this.Next;
        MessageBox.Show("The next worksheet is " + nextSheet.Name);
        MessageBox.Show("This worksheet is the last worksheet.");

.NET Framework Security

See Also


Worksheet Class

Worksheet Members

Microsoft.Office.Tools.Excel Namespace