Aug 08 2020 04:10 AM - last edited on Nov 09 2023 11:08 AM by
Hi team need support to unprotect my sheet which is password protected and forgot the password
Jan 25 2024 02:20 PM
@NikolinoDE hi there i saw your bit about the above but i cant seem to see the code one is to copy then run micros would you be able to DM or email me screen shots or a tutorial video this is where i am at
Jan 25 2024 02:29 PM
Jan 30 2024 12:58 PM
Feb 09 2024 11:28 AM
@NikolinoDE I don't see any on the right of the while pressing ALT+F11 and double click one the workbook!
Thanks
Feb 09 2024 02:44 PM
Feb 10 2024 08:51 PM
Feb 21 2024 02:05 PM
Code does work and works well. Just make sure the .Unprotect call is all in one line as below...
" .Unprotect Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(n) & Chr(o) & Chr(p) & Chr(q) & Chr(r) & Chr(s) & Chr(t)"
If it wraps to next line you will get the error that you mention.
Feb 29 2024 10:32 AM
Hello NikolinoDE,
For some reason everytime I run the macro excel hangs. Would you mind trying to unprotect my document?
Mar 11 2024 09:05 AM
Mar 15 2024 10:03 PM
@NikolinoDE how to use this code?? where do I copy paste this code so as to run it?? in ie or chrome or where??
Mar 16 2024 05:22 AM
@MargaretMP The problem is if any other sheets in the workbook link to the old sheet, once you delete it the dependent formulae will return #REF errors.
Mar 16 2024 04:13 PM - edited Mar 16 2024 04:52 PM
Hi! This is vba code. It needs to be copied and pasted into Excel vba and run it from there. My recommendation is to save a backup copy of your workbook with a new name for safety. Turn off auto recalculation. Then:
1. Create a new blank worksheet. Your wiil be copying data from your protected to the new worksheet.
2. Use the process I described to copy all of the columns with data in your protected worksheet. For example if your data starts in column A, click on column A to highlight the entire column. Don't release the mouse button yet
3. Move the mouse to the right, selecting additional columns until you have selected all columns with data in your worksheet. Right click and copy the columns.
4. Select the new worksheet you created. Select the first column you copied in your protected worksheet (in the example above it was column A)
5. Paste the data into that column. You now have an unprotected copy of your protected worksheet with all of your data.
6. Rename your protected worksheet to something else. Then rename the new worksheet to the same name that your old protected worksheet was named.
7. Delete the old protected worksheet
8. Turn on auto recalculation
If something gets messed up you still have a backup of your original workbook with the protected worksheet if needed.
Good luck!
Mar 17 2024 10:48 AM
Where do you enter the code?
Mar 17 2024 01:17 PM - edited Mar 17 2024 01:21 PM
I do not recommend running or using vba code if you're not experienced. If you want to pursue that course of action, then search the internet for how paste code into a vba module. I'm not able to help further on doing that.
I DO recommend that you use the much simpler and easier method that I previously posted.
Good luck
Mar 17 2024 01:26 PM - edited Mar 17 2024 01:28 PM
It won't return #REF errors if you turn off auto recalculation BEFORE copying the sheet, pasting into a new sheet, temporarily renaming the Protected sheet, renaming the new sheet to the same exact name as the old, protected sheet, turning auto recalculation on again then deleting the old sheet once it is confirmed that the new sheet is working properly.
Mar 25 2024 01:36 PM
Apr 08 2024 07:05 PM
Apr 08 2024 08:03 PM
Great, glad to hear it! If you have a chance, please like my answer!
Apr 28 2024 06:32 AM
If it does not run and you want to recover also worksheet password, change code:
- make the .Unprotect things all on one line(remove the _ at the end line 23)
- add code line 25-28 to display the found password
Option Explicit
Sub GetPass()
Const a = 65, b = 66, c = 32, d = 126
Dim i#, j#, k#, l#, m#, n#, o#, p#, q#, r#, s#, t#
With ActiveSheet
If .ProtectContents Then
On Error Resume Next
For i = a To b
For j = a To b
For k = a To b
For l = a To b
For m = a To b
For n = a To b
For o = a To b
For p = a To b
For q = a To b
For r = a To b
For s = a To b
For t = c To d
.Unprotect Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(n) & Chr(o) & Chr(p) & Chr(q) & Chr(r) & Chr(s) & Chr(t)
If .ProtectContents = False Then
MsgBox "Unprotected: " + Chr(i) + Chr(j) + Chr(k) + Chr(l) + Chr(m) + Chr(n) + Chr(o) + Chr(p) + Chr(q) + Chr(r) + Chr(s) + Chr(t)
End
End If
Next t
Next s
Next r
Next q
Next p
Next o
Next n
Next m
Next l
Next k
Next j
Next i
MsgBox "Unprotected: " + Chr(i) + Chr(j) + Chr(k) + Chr(l) + Chr(m) + Chr(n) + Chr(o) + Chr(p) + Chr(q) + Chr(r) + Chr(s) + Chr(t)
End If
End With
End Sub
Apr 29 2024 03:17 AM