如果指定工作簿有密码保护,则该值为 True。Boolean 类型,只读。
可用 SaveAs 方法为工作簿指定密码保护。
本示例检查当前工作簿是否有密码保护,如果有则显示一条信息。
If ActiveWorkbook.HasPassword = True Then
MsgBox "Remember to obtain the workbook password" & Chr(13) & _
" from the Network Administrator."
End If