Skip to main content

PivotCache.UseLocalConnection property

Table of contents
  1. Syntax
  2. Example

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

Syntax

expression.UseLocalConnection

expression A variable that represents a PivotCache object.

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

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>