Skip to content

Latest commit

 

History

History
51 lines (30 loc) · 1.56 KB

File metadata and controls

51 lines (30 loc) · 1.56 KB
title PivotCache.LocalConnection property (Excel)
keywords vbaxl10.chm227094
f1_keywords
vbaxl10.chm227094
api_name
Excel.PivotCache.LocalConnection
ms.assetid 3afee878-3c05-6b05-4770-e10e4c6f9375
ms.date 05/03/2019
ms.localizationpriority medium

PivotCache.LocalConnection property (Excel)

Returns or sets the connection string to an offline cube file. Read/write String.

Syntax

expression.LocalConnection

expression A variable that represents a PivotCache object.

Remarks

For a non-OLAP data source, the value of the LocalConnection property is an empty string, and the UseLocalConnection property is set to False.

Setting the LocalConnection property does not immediately initiate the connection to the data source. You must first use the Refresh method to make the connection and retrieve the data.

The value of the LocalConnection property is used if the UseLocalConnection property is set to True. If the UseLocalConnection property is set to False, the Connection property specifies the connection string for query tables based on sources other than local cube files.

Example

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

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

[!includeSupport and feedback]