全部显示

RobustConnect 属性

       

返回或设置数据透视表缓存与其数据源的连接方式。String 类型,可读写。

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