title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
Workbook.HasPassword property (Excel) |
vbaxl10.chm199104 |
|
|
e3cfdc90-1e82-5556-0064-e8269ba92539 |
05/29/2019 |
medium |
True if the workbook has a protection password. Read-only Boolean.
expression.HasPassword
expression A variable that represents a Workbook object.
You can assign a protection password to a workbook by using the SaveAs method.
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
[!includeSupport and feedback]