Unprotect the sheet

T

trybharath

Hi,
I want to unprotect the Excel Sheet, I have lost my password. Is there
is any method of unprotecting the Excel sheet with the criteria that
password is not known? If so please give me the code for that...+

Regards,
Shreeram
 
J

Jacques ALARDET

Hello

I find a fast method in a other forum

Sub Test_3()
'_Méthode 3 expéditive sans boucle
Worksheets("Feuil1").Select
W_Timer = Timer
With ActiveSheet
.Protect vbNullString, , True, , , , , , , , , , , , , True
.Unprotect vbNullString
W_Timer = Timer - W_Timer
If .ProtectContents Then GoTo E1 _
Else GoTo E2
End With
FP: On Error GoTo 0: Exit Sub
'=
E1: MsgBox "mot de passe non trouvé": GoTo FP
E2: MsgBox "mot de passe trouvé " & vbCrLf _
& "en " & CInt(W_Timer) & " secondes": GoTo FP
End Sub

J a c q u e s
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top