AllowInsertingHyperlinks 属性

       

如果允许在受保护的工作表上插入超链接,则返回 TrueBoolean 类型,只读。

expression.AllowInsertingHyperlinks

expression   必需。该表达式返回一个 Protection 对象。

说明

在受保护的工作表上,只能将超链接插入未锁定或未保护的单元格中。

可用 Protect 方法的参数设置 AllowInsertingHyperlinks 属性。

示例

本示例允许用户在受保护的工作表上的单元格 A1 中插入超链接,并通知用户。

Sub ProtectionOptions()

    ActiveSheet.Unprotect

    ' Unlock cell A1.
    Range("A1").Locked = False

    ' Allow hyperlinks to be inserted on a protected worksheet.
    If ActiveSheet.Protection.AllowInsertingHyperlinks = False Then
        ActiveSheet.Protect AllowInsertingHyperlinks:=True
    End If

    MsgBox "Hyperlinks can be inserted on this protected worksheet."

End Sub