Share via


Worksheet.Visible Property (2007 System)

Gets or sets a XlSheetVisibility value that determines whether the object is visible.

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

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public Property Visible As XlSheetVisibility
'Usage
Dim instance As Worksheet 
Dim value As XlSheetVisibility 

value = instance.Visible

instance.Visible = value
[BrowsableAttribute(false)]
public XlSheetVisibility Visible { get; set; }
[BrowsableAttribute(false)]
public:
property XlSheetVisibility Visible {
    XlSheetVisibility get ();
    void set (XlSheetVisibility value);
}
public function get Visible () : XlSheetVisibility 
public function set Visible (value : XlSheetVisibility)

Property Value

Type: XlSheetVisibility
One of the XlSheetVisibility values.

Examples

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 Range of used cells.

This example is for a document-level customization.

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

.NET Framework Security

See Also

Reference

Worksheet Class

Worksheet Members

Microsoft.Office.Tools.Excel Namespace