Kommentar
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Gets a Range that represents the underlying native object for the Microsoft.Office.Tools.Excel.NamedRange.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Syntax
'Declaration
ReadOnly Property InnerObject As Range
Range InnerObject { get; }
Property Value
Type: Range
A Range that represents the underlying native object for the Microsoft.Office.Tools.Excel.NamedRange.
Remarks
You can use the InnerObject property to access the underlying Range for the NamedRange and pass it to a method or property that expects a Range passed as a Range. For more information, see Programmatic Limitations of Host Items and Host Controls.
Examples
The following code example starts a series of day names and then creates a NamedRange to contain the series. It then uses the AutoFill method to complete the series. AutoFill requires a Range as a parameter.
This example is for a document-level customization.
Private Sub InnerRange()
Me.Range("A1").Value2 = "Sunday"
Me.Range("A2").Value2 = "Monday"
Dim dayRange As Microsoft.Office.Tools.Excel.NamedRange = _
Me.Controls.AddNamedRange(Me.Range("A1", "A7"), _
"dayRange")
Me.Range("A1", "A2").AutoFill(dayRange.InnerObject, _
Excel.XlAutoFillType.xlFillDays)
End Sub
private void InnerRange()
{
this.Range["A1"].Value2 = "Sunday";
this.Range["A2"].Value2 = "Monday";
Microsoft.Office.Tools.Excel.NamedRange dayRange =
this.Controls.AddNamedRange(this.Range["A1", "A7"],
"dayRange");
this.Range["A1", "A2"].AutoFill(dayRange.InnerObject,
Excel.XlAutoFillType.xlFillDays);
}
.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.