Workbook.HasPassword (Excel)

True if the workbook has a protection password.

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


Dim booHasPassword As Boolean
booHasPassword = ActiveWorkbook.HasPassword