Forum Discussion
How can I remove password protection from excel file in Windows 11?
PowerShell is a native Windows command-line tool that delivers a script-based method to remove password protection from excel. It leverages Excel’s COM component to programmatically lift sheet locks without third-party apps, you just need to modify the file path and password in the script to finish unlocking worksheets locally.
How to Remove password protection from Excel
1. Search PowerShell in the Start Menu, right-click it and select Run as Administrator.
2. Copy the below script, replace the file path and sheet password with your real information:
$excel = New-Object -ComObject Excel.Application
$workbook = $excel.Workbooks.Open("C:\path\to\yourfile.xlsx")
$worksheet = $workbook.Worksheets.Item(1)
$worksheet.Unprotect("password_here")
$workbook.Save()
$workbook.Close()
$excel.Quit()3. Paste the edited script into the PowerShell window and press Enter to run.
4. The target worksheet’s password protection will be removed automatically once the script finishes executing.
Disadvantages
- Microsoft Excel must be installed on the device; otherwise, COM component calls will fail.
- Command-line operations are not user-friendly for users without basic scripting knowledge.
This local scripting solution uses only Windows' built-in tools and is suitable for tech-savvy users who already know the worksheet password and prefer not to use cloud-based upload tools.
ps
- Replace the path C:\path\to\yourfile.xlsx with the actual full path where your Excel file is stored.
- Replace password_here with the actual password for the locked worksheet.
- This method only removes edit protection from the worksheet; it does not bypass the workbook’s full open password.
- Keep the PowerShell window open until the process is complete to prevent file corruption.