Connect 属性

       

返回或设置指定 COMAddIn 对象的连接状态。Boolean 类型,可读写。

说明

如果该加载项是活动的,那么 Connect 属性返回 True,反之返回 False。活动加载项是经过注册并建立了连接的加载项;非活动加载项是经过注册但当前没有连接的加载项。

示例

以下示例在消息框中显示 COM 加载项是否已经注册及其当前的连接状态。

If Application.COMAddIns(1).Connect Then
    MsgBox "The add-in is connected."
Else
    MsgBox "The add-in is not connected."
End If