主题
ProtectStructure (属性)
如果工作簿中的工作表次序处于保护状态,则该属性值为 True。bool 类型,只读。
示例
python
#本示例检查活动工作簿中工作表结构是否受保护,如果是则显示一条消息
def test():
if ActiveWorkbook.ProtectStructure:
print("Remember, you cannot delete, add, or change the location of any sheets in this workbook.")
python
#本示例演示第一个工作簿先开启保护工作簿,再检查工作表结构是否受保护,若受保护则提示已处于保护状态
def test():
Application.Workbooks.Item(1).Protect("Y6dh!et5", True, True)
if Workbooks.Item(1).ProtectStructure:
print("工作表次序已处于保护状态")