Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading password protected XLSX on linux (and windows) with Perl

Tags:

linux

excel

perl

I'm trying write a simple perl script that reads some fields from a password protected XSLX file.

I've looked at Spreadsheet::XLSX and SimpleXlsx but neither seem to support password protected files.

Any idea how this can be done?

Using Win32::OLE This is done like so:

my $Book =
  $Excel->Workbooks->Open( { FileName => $file, Password => $password } );
like image 811
Jim Avatar asked Oct 10 '22 14:10

Jim


1 Answers

None of the current Perl xlsx reading modules support reading encrypted files.

It isn't straightforward to decrypt these files since the encrypted XML files are stored in an OLE container document as opposed to the usual ZIP container.

like image 162
jmcnamara Avatar answered Oct 13 '22 10:10

jmcnamara