Open AndyTuke opened 1 year ago
Would've been surprised if that worked!
Never thought of supporting that, Remove-Password
would be the function name.
Search for EPPlus and remove password. Let me know if you find something.
May be an easy way to use or add this as a feature.
I assumed it would be easy, and read this post https://stackoverflow.com/questions/42860894/remove-known-excel-passwords-with-powershell where one response states that he used ImportExcel to achieve it. Wondering what he did. I found a hefty price tag on EPPlus ...
yeah that is v5|v7 of EPPlus. This module uses v4.x of EPPlus. They may have had a solution or workaround.
The solution looks like what I was going to suggest off the top of my head and has nothing really to do with the module.
It uses Import-Excel to read the xlsx and then Export-Excel to save it to another file without a password.
👉 NOTE: Import-Excel
only reads the data, no formatting etc, etc, etc
I have tried to write a script to remove passwords from Excel workbooks based on this sort of logic
If I supply no password parameter it saves the file with the original password as you'd expect If I supply a new password string it saves the file with that, again as you'd expect If I set $Password to equal $null or "" or '' no file is saved
Without this option how can I remove passwords from Excel workbooks