如果数据透视表缓存与联机分析处理 (OLAP) 服务器相连,则返回 True。Boolean 类型,只读。
expression.OLAP
expression 必需。该表达式返回一个 PivotCache 对象。
本示例判断缓存是否与 OLAP 服务器相连。本示例假定数据透视表位于活动工作表上。
Sub CheckPivotCache()
' Determine if PivotCache has OLAP connection.
If Application.ActiveWorkbook.PivotCaches.Item(1).OLAP = True Then
MsgBox "The PivotCache is connected to an OLAP server"
Else
MsgBox "The PivotCache is not connected to an OLAP server."
End If
End Sub