Password lost

I have inadvertantly set a unintended password on a spreadsheet page and cannot unlock the sheet.
How can my sheet be unlocked?
Thanks

Are refering to the spreadsheet file or a single sheet in the spreadsheet?

You have a very long discussion here explaining why it is impossible.

But, in the same thread, you’ll find a macro trying to guess what the password is, provided some favourable circumstances are met. Have a try but success is not guarantedd.

If it is not a password to encrypt the document (in which case there’s nothing but brute force trying all possibilities) but only a password to protect a sheet, then it is more or less only a flag in the document that can be removed. It depends on the document format. In an .ods zip file it is in the content.xml file’s element table:table, remove the table:protected and table:protection-key and table:protection-key-digest-algorithm attributes and freshen the .ods zip with the modified file. In an .xlsx zip file it is in an xl/worksheets/sheet*.xml file, remove the entire <sheetProtection…/> element and freshen the .xlsx zip with the modified file. If this is all mumbo-jumbo to you ask someone who can do it for you.

Thanks for a detailed explanation.

Now also available as FAQ.

Nice having a reference place.