Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I have a fairly complex (by my standards) process that extracts Excel files (.xls) from certain inbound emails and saves them in a directory on my Debian/Squeeze machine.

My next step would have been to use xls2csv (catdoc) to convert the .xls files into .csv, before modifying it using regex and loading it into a database.

However, I just realized that each sheet in the .xls files is locked, preventing xls2csv from converting them into .csv format.

Is there a command/solution to batch unprotect the sheets in .xls files in a directory? (The idea is to unprotect them in-place, without opening them one at a time.)

share|improve this question
I am not sure, but I am reasonably confident that you will have to open each file individually because the sheet locking is a worksheet property rather than a file level property. – Pynner Jan 27 '13 at 16:46
Just a wild guess: LibreOffice has extensive internal APIs, perhaps there is a way of doing this? – vonbrand Jan 28 '13 at 1:42
@vonbrand Possibly. I will scour through the LibreOffice documentation. FYI, I also tried pyexcelerator, hoping that it might convert locked worksheets into .csv, but it didn't work. – Spartanblogger Jan 28 '13 at 3:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.