3

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.)

terdon
  • 234,489
  • 66
  • 447
  • 667
Spartanblogger
  • 587
  • 3
  • 9
  • 16
  • 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 01: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 03:48

0 Answers0