返回或设置数据透视表缓存与其数据源的连接方式。String 类型,可读写。
XlRobustConnect 可为以下 XlRobustConnect 常量之一。 |
xlAlways 缓存总是使用外部源信息(由 SourceConnectionFile 或 SourceDataFile 属性定义)进行重新连接。 |
xlAsRequired 通过使用 Connection 属性,缓存利用外部源信息来进行重新连接。 |
xlNever 缓存从不使用源进行重新连接。 |
expression.RobustConnect
expression 必需。该表达式返回“应用于”列表中的对象之一。
下例确定缓存的连接设置,并通知用户。本示例假定数据透视表位于活动工作表上。
Sub CheckRobustConnect()
Dim pvtCache As PivotCache
Set pvtCache = Application.ActiveWorkbook.PivotCaches.Item(1)
' Determine the connection robustness and notify user.
Select Case pvtCache.RobustConnect
Case xlAlways
MsgBox "The PivotTable cache is always connected to its source."
Case xlAsRequired
MsgBox "The PivotTable cache is connected to its source as required."
Case xlNever
MsgBox "The PivotTable cache is never connected to its source."
End Select
End Sub