I have forgotten the password for an important file(spreadsheet) How can I open it?
You can’t. You wouldn’t expect anyone being able to open your file without the correct password, would you? If there were a way for you, then anyone could use that way.
See this web archive.
Actually it is very easy. Rename the file extension ZIP. So replace ODS with ZIP and then use a program like 7Z to open it as a folder. In the folder, open content.xml with a reader like Notepad++. There is your file. If you want to remove the password,
@gallagheria: The questioner asked about a “file password”. Saving a file with password will create an encrypted file for which on the first level the comment by @mikekaganski holds. On a different level some hints may help to find the correct password again. This was discussed in a thread now archived under the link @ajlittoz posted.
The weak sheet passwords your suggestion would apply to, are something completely different.