OLEDBConnection.ADOConnection property (Excel)

Returns an ADO connection object if the PivotTable cache is connected to an OLE DB data source. Read-only.

Syntax

expression.ADOConnection

expression A variable that represents an OLEDBConnection object.

Remarks

The ADOConnection property exposes the Microsoft Excel connection to the data provider, allowing the user to write code within the context of the same session that Excel is using.

The ADOConnection property is available only for sessions where the data source is an OLE DB data source. When there is no ADO session, the query will result in a run-time error. The ADOConnection property can be used for any OLE DB-based cache with ADO. The ADO connection object can be used with ADO MD for finding information about OLAP cubes on which the cache is based.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.