if any one tried to unlock the protect sheet with wrong password by default Microsoft message display , that message we can customize as per our need or any other way we can display message we want.
Thanks in advanced.
Don't think there's VBA method that can accomplish it.
Instead you need a simple code to use InputBox for users to enter password.
Something like below.
Code:
Sub UnprotectSheets()
Dim pwd As String
On Error GoTo ErrorHandler
pwd = InputBox("Please Enter Your Password")
If pwd = "" Then Exit Sub
ActiveSheet.Unprotect pwd
ErrorHandler:
MsgBox "Your Message Here"
End Sub
However, users are still able to use ribbon to unprotect sheet. To disable that... it's bit more complex and depends on your Excel version. If 2007 or later you will need to work with XML. Following link is an excellent resource on ribbon customization.