Skip to content
本页内容

AllowDeletingColumns (属性)

如果允许删除受保护工作表上的列,则返回 Truebool 类型,只读。

说明

可以使用 Protect 方法参数设置 AllowDeletingColumns 属性。

对于受保护的工作表,必须取消对包含要删除的单元格的列的锁定。

示例

python
#本示例取消对受保护的工作表上的列 A 的锁定,然后允许用户删除列 A 并通知用户
def test():
    Application.ActiveSheet.Unprotect()
    # Unlock column A.
    Columns.Item("A:A").Locked = False
    # Allow column A to be deleted on a protected worksheet.
    if Application.ActiveSheet.Protection.AllowDeletingColumns == False:
        Application.ActiveSheet.Protect(None, None, None, None, None, None, None, None, None, None, None, True)
    print("Column A can be deleted on this protected worksheet.")
python
#本示例显示是否允许删除受保护工作表上的列
def test():
    print(Worksheets.Item(1).Protection.AllowDeletingColumns)