會保護活頁簿,使其無法進行修改。
語法
表達。保護 (密碼、結構、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 支援與意見反應。