is_locked属性

is_locked属性

True 表示当工作表受到保护时,对象不能被修改。 请注意,仅当工作表或工作表中的对象受到保护时,此值才有意义。

例子


# Sets the specified shape to unlocked state
if shape.worksheet.is_protected and shape.is_locked:
    shape.is_locked = False
# Sets the specified shape to a locked state
if shape.worksheet.is_protected and notshape.is_locked:
    shape.is_locked = True

定义:

@property
def is_locked(self):
    ...
@is_locked.setter
def is_locked(self, value):
    ...

也可以看看