主题
ProtectWindows (属性)
如果工作簿窗口受保护,则该属性值为 True。bool 类型,只读。
示例
python
#本示例检查活动工作簿窗口是否受保护,如果是则显示一条消息
def test():
if ActiveWorkbook.ProtectWindows:
print("Remember, you cannot rearrange any window in this workbook.")
python
#本示例演示活动工作簿先开启保护工作簿窗口,再检查活动工作簿窗口是否受保护,若受保护则提示已处于保护状态
def test():
ActiveWorkbook.Protect(None, None, True)
if ActiveWorkbook.ProtectWindows:
print("活动工作簿窗口已处于保护状态。")