NamedRange.Left Property (2007 System)
Gets the distance from the left edge of column A to the left edge of the NamedRange control.
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 ReadOnly Property Left As Object
'Usage
Dim instance As NamedRange
Dim value As Object
value = instance.Left
[BrowsableAttribute(false)]
public Object Left { get; }
[BrowsableAttribute(false)]
public:
property Object^ Left {
Object^ get ();
}
public function get Left () : Object
Property Value
Type: System.Object
The distance from the left edge of column A to the left edge of the NamedRange control.
Remarks
If the range is more than one column wide, the leftmost column in the range is used.
If the window is maximized, Left returns a negative number that varies based on the width of the window border. Setting Left to 0 (zero) will make the window a tiny bit smaller than it would be if the application window were maximized. In other words, if Left is 0 (zero), the left border of the main Microsoft Office Excel window will just barely be visible on the screen.
Examples
The following code example creates a NamedRange control. It then uses the Left and Top properties to display the distance from the left edge of column A to the left edge of the NamedRange, and the distance from the top of row 1 to the top edge of the NamedRange.
This example is for a document-level customization.
Private leftAndTopRange As Microsoft.Office.Tools.Excel.NamedRange
Private Sub DisplayLeftAndTop()
leftAndTopRange = Me.Controls.AddNamedRange( _
Me.Range("B4", "D6"), "addIndentRange")
leftAndTopRange.Select()
MessageBox.Show("The left border of the NamedRange " & _
"control is at " & Me.leftAndTopRange.Left & _
" and the top is at " & Me.leftAndTopRange.Top & ".")
End Sub
Microsoft.Office.Tools.Excel.NamedRange leftAndTopRange;
private void DisplayLeftAndTop()
{
leftAndTopRange = this.Controls.AddNamedRange(
this.Range["B4", "D6"], "addIndentRange");
leftAndTopRange.Select();
MessageBox.Show("The left border of the NamedRange control "
+ "is at " + this.leftAndTopRange.Left +
" and the top is at " + this.leftAndTopRange.Top + ".");
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.