Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community

How to unprotect the excel sheet if forgot the password

Copper Contributor

Hi team need support to unprotect my sheet which is password protected and forgot the password


286 Replies



I've uploaded a locked worksheet to Google Drive. I was able to edit it there, then download back to my computer unlocked.

@NikolinoDEI ran, and after a long time, it said "Finished", but the worksheet was still password protected, and when I clicked "unprotect sheet," it asked for the password. I did that twice and the second time, I saved it as a Visual-basic enabled excel. Any idea?

@NikolinoDE Can you please help 


I am getting an error in between

There is a very simple way of doing it without any 3rd party software whether its free or not. I just did it and can confirm it works every time. You also don't have to send your file to get the protection removed as this may not be a great option because if you have sensitive information I'm sure you wouldn't want a stranger to see. With this method I used WinZip and it worked great. Basically you change the file extension of the password protected excel file to .zip or to .rar if using WinRAR and proceed to change the code within the file this way rather than copying some code opening developer options pasting the code in a window and selecting RUN. I have seen some posts mentioning this .zip method and I have noticed that they mention to unzip/extract the files once you change the file extension and then save and recompress the file back before changing the extension back to excel format. I found that you don't have to do this which would cut down on more steps which in turn would reduce mistakes. You can just right click on the file and select open with File Explorer find the files that are protected, remove the protection and overwrite the file that was changed. I haven't tested this on many different excel file extensions but I can vouch for the most up to date if not very close to up to date excel software and the .xlsm file extension. If anyone has one they would like for me to test out I'd be glad to do so. Another great point to mention about this method is you can create a copy of the protected file and proceed with removing the lock on the copied version just incase something goes wrong and corrupts the excel file, you still have the original protected file to fall back on. Create another copy rinse and repeat until you get it right! If anyone needs help let me know and I can write out the steps verbatim so you can gain access to your file again! 

So I have tried this method with entering the code provided every which way that was stated in this post/dialogue/forum, whatever you want to call it and I keep running into the issue with "Program not responding". The file is quite large but I have sat here and waited up to 30 minutes and the program still shows not responding so I have to force close. Is this normal? Is there a certain time limit for the code to run before you say "its not working"? I have found the changing the file extension to .zip and editing the code within the files.

@AmaznAzn  For my sheet, the program finished after a few hours (for a relatively compact data sheet).
Unfortunately, the sheet was still protected, so in the end it did not work out for me as expected...

I accepted my 'loss" and rebuilt the sheet from scratch (and now I create a PDF export for publication purposes, so nobody is able to adapt the data)


So I was able to remove the protection on this file you have supplied in less than 10 mins.
Very sorry to hear that. I wish I would have found this thread earlier. The method I have come across, and after reading through the posts, others have mentioned this method has worked well. There is no running a code to decipher and disable a password. You essentially go straight into the files and find the protection and remove it. I have noticed that people mention to extract the file but I have found you don't even have to do that. Thanks for your response!!

Hi @NikolinoDE, Can I send you my workbook to see if you can help? Since the page is password protected, it wont let me operate the VBA. Please help!



Hi.  Can you run this on an Excel spreadsheet for me?  I couldn't get the instructions to work, my fault, I'm sure.

I am unable to "Choose "Insert" > "Module.", it appears the entire workbook is locked vs specific worksheets within it, is there a way to insert code from the top level or am I out of luck?

I looked into saving it as Excel 97-2003 but it stripped days worth of data and functionality. Unfortunately uploading it elsewhere is not an option given sensitivity of data

@MargaretMP NO. If you copy the sheet, you copy also the protection.

I am getting a syntax error with the .unprotect line highlighted



can you please help me unlock an excel sheet, the CFO created this and can’t remember the password 


thank you





Good Day Would it be possible for you to assist me to unlock the following file.


Many Thanks


@Eviee1265 if you have the .unprotect issue - 


backspace the line underneath that one, until you delete the “_”. The _ was serving as a line break. You can delete it and leave that line of code longer to avoid the formatting issue. 

note: this worked on my version of excel. It seems like it worked for plenty of people with the original formatting too.

@NikolinoDE Does this still work for new excel versions? I am getting an error on the Sub GetPass() command at the beginning.



Open with 7-zip>open Archive > then


"%.xlsx\xl\worksheets\" find your worksheet in this path.


then right click and edit, you can see this part like that 

<sheetProtection password="D2AC"