Verify Password Used to Protect the Worksheet

[ ]

The Protection.VerifyPassword method returns true if the specified password matches the password used to protect the given worksheet and false if the specified password does not match. Following piece of code uses the Protection.VerifyPassword method in conjunction with Protection.IsProtectedWithPassword property to detect the password protection, and verifies the password.