Partager via


OLEDBConnection.UseLocalConnection Property (Excel)

True if the LocalConnection property is used to specify the string that enables Microsoft Excel to connect to a data source. False if the connection string specified by the Connection property is used. Read/write Boolean.

Version Information

Version Added: Excel 2007

Syntax

expression .UseLocalConnection

expression A variable that represents an OLEDBConnection object.

Remarks

This example sets the connection string of the first PivotTable cache to reference an offline cube file.

Example

With ActiveWorkbook.PivotCaches(1) 
 .LocalConnection = _ 
 "OLEDB;Provider=MSOLAP;Data Source=C:\Data\DataCube.cub" 
 .UseLocalConnection = True 
End With 

See Also

Concepts

OLEDBConnection Object Members

OLEDBConnection Object