Wiki Markup |
---|
{description} {excerpt}A {{NamedObject}} object may refer to an array, number, picture, or range. To create a {{NamedObject}} in an Excel file, use the corresponding method for the specific object you wish to create \([Pictures.CreatePicture\(\)|Pictures.CreatePicture], [Workbook.CreateRange\(\)|Workbook.CreateRange], etc\). To get a {{NamedObject}} from an existing file, use [Workbook.GetNamedObject\(\)|Workbook.GetNamedObject(String)], passing in the name of the object you wish to get. {excerpt} {signature:C#} public sealed class NamedObject {signature}{signature:vb.net} Public NotInheritable Class NamedObject {signature} {example} The following sample gets a {{NamedObject}} from a [Workbook|Workbook]. {code:csharp|title=C#} ExcelApplication xla = new ExcelApplication(); Workbook wb = xla.Open(@"C:\MySpreadsheet.xls"); NamedObject namedObj = wb.GetNamedObject("MyNamedObject"); {code} {code:vbnet|title=vb.net} Dim xla As New ExcelApplication() Dim wb As Workbook = xla.Open("C:\MySpreadsheet.xls") Dim namedObj As NamedObject = wb.GetNamedObject("MyNamedObject") {code} {example} {properties} ||Name||Description|| |[Formula|NamedObject.Formula]|{excerpt-include:NamedObject.Formula|nopanel=true}| |[Name|NamedObject.Name]|{excerpt-include:NamedObject.Name|nopanel=true}| |[NamedObjectType|NamedObject.NamedObjectType]|{excerpt-include:NamedObject.NamedObjectType|nopanel=true}| |[NameScope|NamedObject.NameScope]|{excerpt-include:NamedObject.NameScope|nopanel=true}| |[Value|NamedObject.Value]|{excerpt-include:NamedObject.Value|nopanel=true}| {classes} ||Name||Description|| |[BuiltInName|NamedObject.BuiltInName]|{excerpt-include:NamedObject.BuiltInName|nopanel=true}| |[ReturnType|NamedObject.ReturnType]|{excerpt-include:NamedObject.ReturnType|nopanel=true}| |[Scope|NamedObject.Scope]|{excerpt-include:NamedObject.Scope|nopanel=true}| {remarks} Named objects with type {{ReturnType.Range}} can also be accessed (as {{Range}} objects) through the {{Workbook.GetNamedRange}} and {{Worksheet.GetNamedRange}} methods. These objects will change their value like other ranges in response to adding or deleting rows, and other similar actions. Named objects with type {{ReturnType.Formula}} and {{ReturnType.ExternalReference}}, though they may contain formulas with cell references, will not respond to such actions. {remarks} |
Page History
Overview
Content Tools