다음을 통해 공유


Workbook.HasPassword Property (Excel)

True if the workbook has a protection password. Read-only Boolean.

Syntax

.HasPassword

A variable that represents a Workbook object.

Remarks

You can assign a protection password to a workbook by using the SaveAs method.

Example

This example displays a message if the active workbook has a protection password.

If ActiveWorkbook.HasPassword = True Then 
 MsgBox "Remember to obtain the workbook password" & Chr(13) & _ 
 " from the Network Administrator." 
End If

참고 항목

개념

Workbook Object

Workbook Object Members