How do I password protect spreadsheet so that a password is needed to open and view spreadsheet

How do I set a password so that a spreadsheet can not be opened and viewed without the password. Xcel has this function.

File - Properties - Security - Protect… and enter your password. - protects from modification i.e. traces changes.
File - Save As… and choose save with password to protect document from opening i.e. prompts password to open.

Documents in ODF format can be saved with a password, so they cannot be opened without it.

Simply go to File | Save as… and select the option Save with a password.