Skip to content

Latest commit

 

History

History
160 lines (110 loc) · 3.13 KB

File metadata and controls

160 lines (110 loc) · 3.13 KB

Binding

The Binding object is a member of the Bindings collection. The Bindings collection contains all the Binding objects in a workbook.

Property Type Description Notes
id String String The user-visible name of the binding. Get only.
index Number The zero-based index of the binding within the workbook Binding.Index
type String Returns the type of the binding. Can be Table,Range or Text. Get only. Binding.Type

Relationships

None.

Methods

The Binding has the following methods defined:

Method Return Type Description Notes
getRange() Range object Returns the Range of the Binding
getTable() Table object Returns the Table of the Binding
getText() String Returns the text of the Binding

API Specification

getRange()

Get a Range object that represents a single cell or a range of cells.

Syntax

bindingObject.getRange();

Parameters

None.

Returns

Range object.

Examples

Below example uses binding to get the range.

var ctx = new Excel.ExcelClientContext();
var binding = ctx.workbook.bindings.getItemAt(0);
var range = binding.getRange();
ctx.load(range);
ctx.executeAsync().then(function() {
	Console.log(range.cellCount);
});

Back

getTable()

Get the table of the binding.

Syntax

bindingObject.getTable();

Parameters

None

Returns

Table object.

Examples

var ctx = new Excel.ExcelClientContext();

var binding = ctx.workbook.bindings.getItemAt(0);
var table = binding.getTable();
ctx.load(table);
ctx.executeAsync().then(function () {
		Console.log(table.name);
});

Back

getText()

Get the text of a binding.

Syntax

bindingObject.getText();

Parameters

None.

Returns

String.

Examples

Below example uses binding to get the range.

var ctx = new Excel.ExcelClientContext();
var binding = ctx.workbook.bindings.getItemAt(0);
var text = binding.getText();
ctx.load(text);
ctx.executeAsync().then(function() {
	Console.log(text);
});

Back

Get Binding

Get a Binding object properties.

Syntax

bindingObject.type;

Properties

Property Type Description Notes
id String String The user-visible name of the binding
index Number The zero-based index of the binding within the workbook Binding.Index
type String Returns the type of the binding. Binding.Type

Returns

Binding object.

Examples

Below example to get binding properties.

var ctx = new Excel.ExcelClientContext();
var binding = ctx.workbook.bindings.getItemAt(0);
ctx.load(binding);
ctx.executeAsync().then(function() {
	Console.log(binding.type);
});

Back