Share via


(Excel) 的 Workbook.Protect 方法

會保護活頁簿,使其無法進行修改。

語法

運算式保護 (密碼結構Windows)

表達 代表 Workbook 物件的 變數。

參數

名稱 必要/選用 資料類型 描述
Password 選用 Variant 字串,用於指定工作表或活頁簿的密碼,該密碼區分大小寫。 如果省略這個引數,則不需使用密碼就可以取消對該工作表或活頁簿的保護。 否則,必須指定密碼,才能取消對該工作表或活頁簿的保護。 如果忘記密碼,就無法取消對該工作表或活頁簿的保護。

Use strong passwords that combine uppercase and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27.

Passwords should be 8 or more characters in length. A pass phrase that uses 14 or more characters is better.

請務必記住您的密碼。 If you forget your password, Microsoft cannot retrieve it. Store the passwords that you write down in a secure place away from the information that they help protect.
結構 選用 Variant 如果為 True,則會保護活頁簿的結構 (工作表的相對位置)。 預設值為 False
Windows 選用 Variant 如果為 True,則會保護活頁簿視窗。 如果省略此引數,則不會保護視窗。

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應