Excel.DataConnectionCollection class

Represents a collection of all the data connections that are part of the workbook.

Extends

Remarks

[ API set: ExcelApi 1.7 ]

Properties

context

The request context associated with the object. This connects the add-in's process to the Office host application's process.

Methods

refreshAll()

Refreshes data connections in the collection, such as from a PivotTable to a Power BI dataset, or a Data Model to a table or range in the same workbook. Data connections unsupported by this method are: Power Query connections, data connections outside the original workbook (except Power BI connections), and connections to data protected by a firewall.

toJSON()

Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that is passed to it.) Whereas the original Excel.DataConnectionCollection object is an API object, the toJSON method returns a plain JavaScript object (typed as Excel.Interfaces.DataConnectionCollectionData) that contains shallow copies of any loaded child properties from the original object.

Property Details

context

The request context associated with the object. This connects the add-in's process to the Office host application's process.

context: RequestContext;

Property Value

Method Details

refreshAll()

Refreshes data connections in the collection, such as from a PivotTable to a Power BI dataset, or a Data Model to a table or range in the same workbook. Data connections unsupported by this method are: Power Query connections, data connections outside the original workbook (except Power BI connections), and connections to data protected by a firewall.

refreshAll(): void;

Returns

void

Remarks

[ API set: ExcelApi 1.7 ]

toJSON()

Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that is passed to it.) Whereas the original Excel.DataConnectionCollection object is an API object, the toJSON method returns a plain JavaScript object (typed as Excel.Interfaces.DataConnectionCollectionData) that contains shallow copies of any loaded child properties from the original object.

toJSON(): {
            [key: string]: string;
        };

Returns

{ [key: string]: string; }