主题
AllowInsertingHyperlinks (属性)
如果允许在受保护的工作表上插入超链接,则返回 True。bool 类型,只读。
说明
在受保护的工作表上,只能将超链接插入未锁定或未保护的单元格中。
可以使用 Protect 方法参数设置 AllowInsertingHyperlinks 属性。
示例
python
#本示例允许用户在受保护的工作表上的单元格 A1 中插入超链接,并通知用户
def test():
Application.ActiveSheet.Unprotect()
# Unlock cell A1.
Range("A1").Locked = False
# Allow hyperlinks to be inserted on a protected worksheet.
if Application.ActiveSheet.Protection.AllowInsertingHyperlinks == False:
Application.ActiveSheet.Protect(None, None, None, None, None, None, None, None, None, None, True)
print("Hyperlinks can be inserted on this protected worksheet.")
python
#本示例显示是否允许在受保护的第二张工作表上插入超链接
def test():
print(Worksheets.Item(2).Protection.AllowInsertingHyperlinks)