Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I prevent Openoffice from opening a particular xlsm file? Or, how can I make sure that only Excel is allowed to open that particular xlsm file?

I have created an xlsm file, which has a tab with secret data.

The tab is hidden, and the code is protected by password. However, when someone opens the same file in OpenOffice calc, all the tabs come out in the open. This includes even the hidden tab with the confidential data.

How can I prevent this?

share|improve this question

migrated from Jan 14 '13 at 13:47

This question came from our site for professional and enthusiast programmers.

If you have data you'd like to keep confidential, password protect the entire document (better still use something like TrueCrypt), or simply don't pass it on to other people. Trying to artificially restrict opening a file to a single program is an exercise in futility (especially more so if the PC on which the file is opened is not your own). – Karan Jan 15 '13 at 17:37

It's simply not possible to enforce using a certain application to open your document. By their nature, files may be opened by any and every application. Whether or not the application understands the data is another matter.

Based on the fact that opening your sensitive document in OpenOffice reveals the sensitive information, your file is not secure, and Excel is merely providing the illusion of security. It's like locking your car doors but leaving the windows rolled down. You still use your key to "lock" your car, but there's almost no point if a theif can just reach through your window to access your valuables.

I propose instead of using Excel-specific "password-protection," that you properly encrypt the sensitive data using something like AxEncrypt. This will ensure that only those with the password will be able to access the data.

AxEncrypt typically works on whole files, and not partial files, so I would propose having a sensitive version of the file containing the "secret" tab, which is encrypted, and a non-sensitive version of the file with the "secret" tab omitted.

share|improve this answer
… and perhaps the sensitive version of the file could pull in all the non-sensitive data through links. – Scott Oct 9 '13 at 18:19
Scott, that would be a very elegant solution, and trivial to implement with Excel's support for external data sources. Linking the data would save disk space and maintainability headaches, especially if the non-sensitive data is frequently modified. – StockB Oct 15 '13 at 14:03

I don't know alot about that stuff, but I guess you could write some code for the file. If you write some classes that checks what software it is opened with, and terminates if it's opened in anything other than excel.

Either that, or you could make a password protected standalone .exe for the script.

share|improve this answer suggest that a Macro-enabled workbook (.xlsm) can be opened using openoffice, but Macro-enabled template (.xltm) cannot. You could just try and save as template (.xltm) an hopefully MS opens that only. That said, I think the solution will be temporary. Openoffice is generally not too far behind.

share|improve this answer

You must log in to answer this question.