View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Password Protection

Hi W,

Please replace my suggested code with the following version:

'=============
Public Sub Tester()
Dim PWORD As String

PWORD = InputBox(Prompt:="Please type the password")

On Error Resume Next
ActiveSheet.Unprotect Password:=PWORD

If Err.Number < 0 Then
MsgBox "The password was not recognised"
End If
On Error GoTo 0
End Sub
'<<=============

---
Regards,
Norman