NamedRange.RowHeight Property (2007 System)

Gets or sets the height of all the rows in the NamedRange control, measured in points.

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 RowHeight As Object
'Usage
Dim instance As NamedRange 
Dim value As Object 

value = instance.RowHeight

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

Property Value

Type: System.Object
The height of all the rows in the NamedRange control, measured in points. Returns nulla null reference (Nothing in Visual Basic) if the rows in the specified range are not all the same height.

Remarks

For a single row, the value of the Height property is equal to the value of the RowHeight property. However, you can also use the Height property to return the total height of a range of cells.

Other differences between RowHeight and Height include the following:

  • Height is read-only.

  • If you return the RowHeight property of several rows, you will get either the row height of each of the rows (if all the rows are the same height) or nulla null reference (Nothing in Visual Basic) (if they are different heights). If you return the Height property of several rows, you will get the total height of all the rows.

Examples

The following code example creates a NamedRange and then sets the width of the columns and the height of the rows that are part of the range.

This example is for a document-level customization.

Private setColumnRowRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub SetColumnAndRowSizes()
    setColumnRowRange = Me.Controls.AddNamedRange( _
        Me.Range("C3", "E6"), "setColumnRowRange")
    Me.setColumnRowRange.ColumnWidth = 20
    Me.setColumnRowRange.RowHeight = 25
    setColumnRowRange.Select()
End Sub
Microsoft.Office.Tools.Excel.NamedRange setColumnRowRange;
private void SetColumnAndRowSizes()
{
    setColumnRowRange = this.Controls.AddNamedRange(
        this.Range["C3", "E6"], "setColumnRowRange");
    this.setColumnRowRange.ColumnWidth = 20;
    this.setColumnRowRange.RowHeight = 25;
    setColumnRowRange.Select();
}

.NET Framework Security

See Also

Reference

NamedRange Class

NamedRange Members

Microsoft.Office.Tools.Excel Namespace