Export (0) Print
Expand All
Expand Minimize

WorksheetBase.Visible Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets a Microsoft.Office.Interop.Excel.XlSheetVisibility value that determines whether the object is visible.

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

public XlSheetVisibility Visible { get; set; }

The following code example uses the Visible property to help select the range of used cells on a worksheet. The example first sets the range of cells from A1 to C3 on the current worksheet to the value 23. If the Visible property indicates that the worksheet is visible, then the example uses the UsedRange property to select the Microsoft.Office.Interop.Excel.Range of used cells.

This example is for a document-level customization.

private void SelectUsedRange()
{
    this.Activate();
    this.Range["A1", "C3"].Value2 = 23;
    if (this.Visible == Excel.XlSheetVisibility.xlSheetVisible)
    {
        this.UsedRange.Select();
    }
}

Show:
© 2014 Microsoft